1 day after custom date change post status to draft

Your question isn’t very clear. Do you mean: 1 day after koncerter_start_date all posts with custom-post-type koncert have to get the status draft? EDIT Code: add_action( ‘wp_loaded’, ‘concert_daily_tasks’ ); function concert_daily_tasks() { $current_url = “https://” . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; if ( $current_url == ‘https://example.com/concert-daily-tasks’ ) { // <– set the correct URL! check_concert_status(); } } … Read more

What is the Javascript event for an item being added to the cart in Woocommerce?

Read the source. From woocommerce-ajax.php (in the plugin’s root folder) Javascript/Ajax add to cart /** * AJAX add to cart * * @access public * @return void */ function woocommerce_ajax_add_to_cart() { global $woocommerce; check_ajax_referer( ‘add-to-cart’, ‘security’ ); $product_id = (int) apply_filters(‘woocommerce_add_to_cart_product_id’, $_POST[‘product_id’]); $passed_validation = apply_filters(‘woocommerce_add_to_cart_validation’, true, $product_id, 1); if ($passed_validation && $woocommerce->cart->add_to_cart($product_id, 1)) : // … Read more

WP_Query meta_query results date by date

My idea is following. 1. Get the array of all meta dates your events have. DISTINCT in the MySQL query means do not include duplicates. <?php /* * From https://wordpress.stackexchange.com/a/9451/11761 */ function get_all_possible_meta_dates( $key = ‘event_dates_wp’, $type=”page”, $status=”publish” ) { global $wpdb; $result = $wpdb->get_col( $wpdb->prepare( ” SELECT DISTINCT pm.meta_value FROM {$wpdb->postmeta} pm LEFT JOIN … Read more

Short code for Venues

There aren’t currently any shortcodes for venue information (address, postcode, other meta etc). However, you can copy the single-event.php template (find it in the templates directory of the plug-in) into your theme and edit it there to include venue information via provided template functions: Available functions When used inside the loop, you don’t need to … Read more

How to use get_categories() with Event Organiser plugin

Event categories are terms in a custom taxonomy, ‘event-category’, so you should use get_terms instead: //Args for which terms to retrieve $args = array(‘type’=> ‘post’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1 ); //Array of taxonomies from which to collect the terms $taxonomies = array(‘event-category’); //Get the terms $terms = get_terms( $taxonomies, $args); //loop through the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)