How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?

I didn’t call the class yet, this code is now working class Scheduler { public $setup; public static $instance; public function __construct() { self::$instance =& $this; add_action(‘scheduler’, [$this, ‘etf_scheduler_func’]); } public function etf_scheduler_func() { $this->setup = new Setup(); $this->setup->set_table(); } public static function &get_instance() { if ( ! isset( self::$instance ) ) self::$instance = new … Read more

How to disable edit post option? [closed]

This will restrict all users, except admins to edit a post after one day. You can, however, change the allowed user roles or time by simply tweaking the code. function wpse405644_restrict_editing() { $screen = get_current_screen(); if ( $screen->base == ‘post’ && $screen->post_type == ‘courses’ ) { $post = get_post($_GET[‘post’]); $user = wp_get_current_user(); if ( !in_array( … Read more

Showing Unpublished Posts to Logged-out Users?

Answered my own question on this one. As it turns out, it was pretty simple in WordPress 2.9.2. Basically, I applied a filter to ‘the_posts’ which would run another query if the object was empty. Because we’re looking up posts that haven’t been published, we need to use our own custom SQL as well. Trying … Read more

WP_Query older new links navigation?

try adding ‘&paged=’.$paged to your query string <?php $mainList_query = new WP_Query(‘cat=4,352,731,754,49,44,54,17&showposts=200&order=DESC&paged=’.$paged); ?>