a Project - http://url.co.uk
Last Updated: DD/MM/YYYY
Contents:
- Purpose of this file
- Authors/contributors
| <?php | |
| /* | |
| * This filter specifies default orderings for meta boxes on article screens. | |
| * | |
| * If a user-specific setting exists for the hidden/order list then that is used | |
| * | |
| * The get_<objecttype>_metadata filter is odd. It's always passed "null" as a value. If | |
| * we return a non-null value then that value is used. If we return null, it will fetch the | |
| * real value. Watch out for that! | |
| */ |
| <?php | |
| /* | |
| * WordPress Custom Columns helper | |
| * | |
| * NOTE: The callback function should echo the output. Use global $post to get the post that's | |
| * being displayed in the list. | |
| * | |
| * Example usage: | |
| * |
Last Updated: DD/MM/YYYY
Contents:
| // AJAX function for listing directory entries alphabetically | |
| add_action('wp_ajax_directory_alpha', 'mytheme_ajax_directory_alpha'); | |
| add_action('wp_ajax_nopriv_directory_alpha', 'mytheme_ajax_directory_alpha'); | |
| function mytheme_ajax_directory_alpha() { | |
| function alpha_post_where( $where ) { | |
| $new_where = $where . " AND lower(substring(post_title, 1, 1)) = lower('" . $_REQUEST['s'] . "')"; | |
| return $new_where; | |
| } |
| /* | |
| * There are a couple of places where we use GravityForms to do a file upload into a | |
| * meta-data item of type "upload". The upload file type stores an attachment ID, | |
| * whereas the Gravity Forms upload field stores a URL. | |
| * | |
| * This function is used to convert a URL in the meta-data item specified by the | |
| * $field parameter to an attachment ID - creating the attachment as it goes. | |
| * | |
| * This function should be called from a callback hooked to gform_after_submission_[x] | |
| * |