Change Title Type

as this is a default field, i don’t think it is possible to achieve what you want with the help function hooks, however you can do this by editing edit-form-advanced.php file inside wp-admin folder, the code you may want to edit is located in line # 291, this is the input type for title field … Read more

Fire a hook programmatically

To fire a hook you can use following functions: do_action – executes a hook created by add_action. do_action_ref_array – execute functions hooked on a specific action hook, specifying arguments in an array. This function is identical to do_action, but the arguments passed to the functions hooked to $tag are supplied using an array. If you … Read more

Redirect back to origin page after using get_delete_post_link()

Theres a filter you can hook on to. apply_filters( ‘get_delete_post_link’, wp_nonce_url( $delete_link, “$action-{$post->post_type}_{$post->ID}” ), $post->ID, $force_delete ); Check the raw function here: http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/link-template.php#L954 Can’t advise much else without seeing your code. Edit: its nasty buy you can do add_filter( ‘get_delete_post_link’, ‘some_function’, 20 ); function some_function() { wp_redirect( home_url(“https://wordpress.stackexchange.com/”) ); exit; }

Query author’s posts & posts that have author’s id as meta value

Instead of a new WP_Query, use the pre_get_posts filter add_filter(‘pre_get_posts’, ‘custom_query’); function custom_query($query) { if($query->is_main_query() && $query->is_author() && $_GET[‘eco’]==’somemetakey’) { $query->set(‘meta_query’, array( array( ‘key’ => ‘somemetakey’, ‘value’ => $query->get(‘author’) ) )); } }

prepopulate form from a hook within wordpress function.php file

You will need to declare the variable global before using it. function simple_form(){ global $firstname; $firstname=”Bob”; //Do something to populate the form field name <fname> with “Bob” } Your form should be able to do … global $firstname; echo $firstname; … to use the variable. However, I can’t help but think there is a better … Read more