How do I remove an action hook by s2member
I resolved this using this code : remove_action(“wp_login”, “c_ws_plugin__s2member_login_redirects::login_redirect”, 10, 2); which I added inside my custom plugin file.
I resolved this using this code : remove_action(“wp_login”, “c_ws_plugin__s2member_login_redirects::login_redirect”, 10, 2); which I added inside my custom plugin file.
hooks.php is not a file that belongs to any native WordPress convention. While copying files from parent theme is often mentioned as a technique it only applies to template files, which are part of template hierarchy (native or properly customized one). Your guess that this is issue of timing is probably accurate. It’s a little … Read more
Hide post completely and still reach it via cURL
I finally found somethings. Not directly by cod it but I find a already wrote plugins for this. http://wordpress.org/plugins/force-post-category-selection/ Hope it’s will help others wordpress user.
Personally I would use wp_get_current_user(), no globals: function plugin_admin_init() { $user = wp_get_current_user(); }
We will use the admin_notices hook to display the information on top of the editor. First, a very basic example function educadme_fill_then_save_admin_notice(){ global $pagenow; if ( $pagenow == ‘post.php’ || $pagenow == ‘post-new.php’ ) { echo ‘<div class=”alert”> <p>This is some text. You can embed images, videos, whatever, and they will display on top of … Read more
addaction hook cause redirection problem
It’s catch 22 – you need WordPress to use the hook system, but init will have already fired during load (wp-settings.php to be exact). I would create a MU “Must Use” plugin (wp-content/mu-plugins/any-filename.php) for all your “outside of WordPress” functionality, with something like this at the start: if ( ! defined( ‘LOADED_EXTERNAL’ ) || ! … Read more
According to the Codex, if you use wp_transition_post_status() you will get both the old version and the new version. wp_transition_post_status( $new_status, $old_status, $post ) The ticket also says that the post type needs to support revisions for the save to work. Check the post type of the post objects before doing anything. If your post … Read more
An easy way to do this would be to create a simple Must Use Plugin and check for your page in a function hooked to an action, like wp_loaded function wpd_check_page_exists(){ $page = get_page_by_title( ‘The Page’ ); if( !$page ){ wp_mail( ‘[email protected]’, ‘a message from your site’, ‘the page is gone!’ ); } } add_action( … Read more