Tag Info

Hot answers tagged

5

TL;DR: No, you can use save_post. Unless you consider programmatic modification of only metadata "modifying a post". There (theoretically) is a way of modifying a post without triggering the save_post action hook: Direct modification of the database. But for one no plugin or theme author in his right mind would go that route and for another it would ...


4

Revisions to me are useless and just fills up your db with unnecessary "posts". It might be useful to others though. Revisions are created each time a post is revised/updated. This just holds an archive/copy of the post before it was updated, and gives the user an option to restore the specific post to an earlier time. This works exactly like any system ...


3

Unfortunately, there is no 'filter' to remove or edit the previous items in the 'At Glance' box. EDIT I removed the "Wordpress Core Hack" part because I don't want to encourage such a behavior, and I don't want you to edit the code every time Wordpress releases a new version :) And here is a code to append custom post types stats without being clickable : ...


2

The dashboard_glance_items filter is only useful for modifying the extra elements. The posts/comments data elements have already been displayed. Here are three ideas: Method #1 - Use the dashboard_glance_items filter: You can use the following filter setup, to remove the posts/pages/comments elements from the output of wp_dashboard_right_now(). The ...


2

Use the filter hook bp_members_signup_error_message Try: function signup_error_change( $error_message ) { $error_message = str_replace('<div class="error">', '<span class="val-error">', $error_message); $error_message = str_replace('</div>', '</span>', $error_message); return $error_message; } ...


2

No extra code needed. Simply include the timestamp parameter onto the YouTube link, with the format of hash t equals number m number s. Or in other words: #t=1m02s The numbers are minutes and seconds. Example of a rickroll pre-fast-forwarded to 1 minute in: http://www.youtube.com/watch?v=dQw4w9WgXcQ#t=1m0s YouTube's oEmbed endpoint seems to handle this ...


2

To add a checkbox you need to use the add_meta_box function, with this you can create a metabox for the new post screen. You have to create a function that generates the checkbox element, and that's it. You can use the action publish_post to call the services you need when it happens, you have other options, like save_post. It really depends on how flexible ...


1

You can try this one: /** * Fires as an admin screen or script is being initialized. * * Note, this does not just run on user-facing admin screens. * It runs on admin-ajax.php and admin-post.php as well. * * This is roughly analgous to the more general 'init' hook, which fires earlier. * * @since 2.5.0 */ do_action( 'admin_init' ); if you need ...


1

You can trigger your web-service-calling code by using this: http://codex.wordpress.org/Plugin_API/Action_Reference/publish_post You can add a checkbox using this: http://codex.wordpress.org/Function_Reference/add_meta_box


1

The $hook_suffix global (copy of which you are getting passed to the hook) doesn't go into such detail. However there is plenty more of context to check. In modern WP versions bulk of it is via get_current_screen() which returns WP_Screen object with plenty of stuff (in this case you would want to check id and post_type properties likely). As for post's ...


1

admin_url( 'admin-post.php' ) is the non-ajax version of admin_url( 'admin-ajax.php' ) Similar to admin-ajax.php it will fire one of four hooks: Logged out users admin_post_nopriv_{action} ($_REQUEST['action'] specified) admin_post_nopriv (no $_REQUEST['action'] specified) Logged in user admin_post_{action} ($_REQUEST['action'] specified) ...


1

I'm guessing the built-in template_redirect action is the best for this... :D http://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect



Only top voted, non community-wiki answers of a minimum length are eligible