Adding custom Bulk Actions
Unfortunately it’s still not really doable in a clean way. You can see the latest about this here in this trac ticket #16031 I just checked the source and the filter is still basically the same.
Unfortunately it’s still not really doable in a clean way. You can see the latest about this here in this trac ticket #16031 I just checked the source and the filter is still basically the same.
You are already pretty close. Extending your example: In your plugin put this: $default_settings = array( ‘key_one’ => 0, ‘key_two’ => 1 ); $settings = apply_filters( ‘example_filter’, $default_settings); Then a theme can change it like this: add_filter(‘example_filter’,’my_function’); function my_function($settings){ $settings[‘key_one’] = 1; return $settings; }
By default, the add_action function is only going to pass 1 parameter, but you can define how many do you have / need $accepted_args (int) (optional) The number of arguments the hooked function accepts. In WordPress 1.5.1+, hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run. … Read more
Try this way, should work well function cpt_from_attachment($attachment_ID) { global $current_user; get_currentuserinfo(); $attachment_post = get_post( $attachment_ID ); $type = get_post_mime_type($attachment_ID); // DO WHAT YOU NEED } add_action(“add_attachment”, ‘cpt_from_attachment’);
You’re adding a filter to get_search_query, and within that function calling get_search_query, which runs your filter, which calls get_search_query, which runs your filter, which calls get_search_query, which runs your filter… do you see the problem here? The search query is passed to the filter as an argument, so you don’t need to fetch it- function … Read more
If you check out the source, you find the following actions related to the modifications of the navigational menus: Update: /** * Fires after a navigation menu has been successfully updated. * * @since 3.0.0 * * @param int $menu_id ID of the updated menu. * @param array $menu_data An array of menu data. */ … Read more
Since Milo is a genius, I got this done much simpler by just looping through the array inside of the function, instead of trying to generate a new function dynamically for each item. The array contains ‘slug’ and ‘title’ attributes, and here’s the function: function cx_product_field() { global $fieldset; foreach ( $fieldset as $field ){ … Read more
I see two things. You’re missing an action call – you need add_action( ‘wp_ajax_render_admin_charts_page’, ‘render_admin_charts_page’ ); add_action(‘wp_ajax_nopriv_render_admin_charts_page’, ‘render_admin_charts_page’); Plus, from looking at your render_admin_charts_page() you need to change your json dataType to html. Your charts function is outputting html so all you need to do is output it; your alert() should contain all the html … Read more
I think the path to the image is wrong, use get_stylesheet_directory_uri() to retrieve the style.css path. If this isn’t it let me know and I will take a closer look. I just dug out an example which worked for me in the past: function my_login_logo() { ?> <style type=”text/css”> body.login div#login h1 a { background-image: … Read more
For this, you have to use user_register hook defined on wp-includes/users.php line 1759. personal_options_update hook is called, when an user updating his own profile. edit_user_profile_update is called, when an administrator updating other user profile. nothing is called, when an administrator creating a new user. On user-new.php page, new user are created using the edit_user function, … Read more