template_redirect and title
template_redirect and title
template_redirect and title
Errm, you can’t. And more importantly, why would you want to? The whole point of hooks is to open up an API to other developers! You can use a singleton/static flags and/or private methods (called from a hooked public method) if you want to lock down how your plugin can be manipulated. static function myfunction_for_themes() … Read more
Object oriented programming, add_action in constructor not firing
Send email to post author 1 day before his project ends
Generally after_setup_theme is the first action hook available to themes, triggered immediately after the active theme’s functions.php file is loaded. At this stage, the current user is not yet authenticated.
How to work with hooks and Posts to posts plugin?
Here is the description of transition_post_status from the codex: This function’s access is marked as private. That means it is not intended for use by plugin and theme developers, but only in other core functions. It is listed here for completeness. Use any of these functions instead. Why not use the publish_post action instead? There … Read more
How is $_GET[‘post’] set ? And why are you checking it? It could be that you’re adding the save_post call too late. Try: function foo() { die(‘Saving post’); } function foo2() { if( isset($_GET[‘post’]) ) foo(); } add_action( ‘save_post’, ‘foo2’ );
WP-Automatic to run publish hooks
I was able to solve my problem by calling set_post_format in my save_post callback and making sure to check if its set and not equal to the “no change” option. Not sure if this is the best way to go, but it works. require( plugin_admin_dir . ‘plugin-sync.php’ ); add_action( ‘save_post’, ‘savethepost’, 2000); function savethepost($post_id) { … Read more