disable column on post and user list

You can use the manage_{$screen->id}_columns hooks for this. To manage user columns we can use manage_users_columns which is passed an array of columns and whatever we don’t want we can unset(). /** * Manage User Admin Display Table Columns * * @param Array $columns * [cb] => <input type=”checkbox” /> * [username] => Username * … Read more

Play Video on Homepage Only

querySelector() returns null if no matches are found, so wrap the code that depends on imagineVideo in a conditional statement. var imagineVideo = document.querySelector(‘.page-id-36 .et_pb_video_box video’); if ( imagineVideo ) { imagineVideo.play(); imagineVideo.loop = true; imagineVideo.controls = false; } If you only want this code to be loaded on the homepage, you can put it … Read more

select a private page as parent for another private page

The following conditions is assumed to make it working Classic Editor is in use, since Gutenberg/Block Editor is rendered by Javascript, it requires another solutions and so far I am not sure if there is override option yet. For the code you have shown, it does not work because the number of arguments for add_filter() … Read more

Change the slug of a particular page every x hours

You’ll need a two step process for that. Create a function that actually changes the slug (not rewrite it) Schedule an event in WordPress to run that function in every X hours. Here are something to start with function wpse402903_schedule_event() { add_action( ‘wpse402903_cron’, ‘wpse402903_cron_callback’ ); if ( !wp_next_scheduled(‘wpse402903_cron’) ) { //Change 12 to your interval … Read more

How do I get the next page of posts link?

Why build the link yourself, when you can just add the class to the result of get_next_posts_link()? add_filter(‘next_posts_link_attributes’,’example_add_next_link_class’); function example_add_next_link_class($attr) { return $attr . ‘ class=”example-class”‘; } Now the link sent back by get_next_posts_link() will have your class in it.