Auto Generate Post Title from 2 ACF Taxonomies [closed]

Try this in your functions.php file: add_action(‘save_post’, ‘wpb_autogenerate_events_title’, 10, 3); function wpb_autogenerate_events_title($post_id, $post, $update) { // Check if it’s the ‘events’ CPT and if the title is empty. if (‘events’ !== $post->post_type || !empty($post->post_title)) { return; } // Fetch terms from ‘category’ and ‘nameselection’ taxonomies. $category_term = wp_get_post_terms($post_id, ‘category’, [‘fields’ => ‘names’]); $nameselection_term = wp_get_post_terms($post_id, … Read more

Cronjobs at night – but not the rest of the day

To achieve the behavior you’re describing in WordPress, where a cron job runs hourly but only between 2 AM and 5 AM, you have a couple of options. While WordPress doesn’t offer this level of specificity in its default scheduling, you can customize it to suit your needs. Custom Cron Scheduling: This involves creating a … Read more

How to automatically compare date from custom post type with current date and change taxonomy based on a result?

This is pretty straight forward and easy to do with $wpdb and SQL statement the relationship between any post type (custom or not) and taxonomy term (custom or not ) are stored wp_term_relationships table which has object_id and term_id all you have to do is query the record that has the term_id for active1 term … Read more

automation of plugin installations

Check out TGM-Plugin-Activation plugin. TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference pre-packaged plugins, plugins … Read more

Activate and deactivate two plugins automatically at certain hours

Rather than update the database you could write a mu-plugin to intercept reads from the active_plugins option, e.g. function option_active_plugins_akismet_or_yoast( $plugins ) { if ( !defined(‘WP_ADMIN’) ) { $hour = getdate()[ ‘hours’ ]; if ( $hour >= 10 && $hour < 19 ) { $to_remove=”wordpress-seo/wp-seo.php”; } else { $to_remove=”akismet/akismet.php”; } $remove_index = array_search( $to_remove, $plugins … Read more

techhipbettruvabetnorabahisbahis forumueduseduedusedusedusedusedueduedusedu