PHP Warning: Constant WP_CONTENT_URL already defined

You’ve got that constant defined in two places. The error message tells you where it is first defined: Warning: Constant WP_CONTENT_URL already defined in /var/www/html/my-website/wp-config.php on line 11 Look at line 11 of the wp-config.php file. I’d bet that you’ll find that constant defined there.

Displaying all ACF field labels and values from a specified field-group on WooCommerce product page

I see what you’re trying to achieve. You can use ACF’s acf_get_field_group function with the title as a parameter to retrieve the field group and its ID. Try this code: /*============================================================== Create More Details tab ================================================================*/ if (class_exists(‘acf’) && class_exists(‘WooCommerce’)) { add_filter(‘woocommerce_product_tabs’, function($tabs1) { global $post, $product; $tabs1[‘rpl-‘ . sanitize_title(‘More Details’)] = [ ‘title’ => … Read more

How to find what is causing a slug-2?

Step 1: Get all the available post types. This is done with the following query global $wpdb; $query = “SELECT DISTINCT post_type FROM {$wpdb->posts}”; $results = $wpdb->get_results($query); foreach ($results as $result) { echo “‘” . $result->post_type . “‘,”; } Step 2: Use WP_Query to find the instance with the original slug: $slug = ‘support’; $args … Read more

WordPress converting ‘ to ’ and – to –?

This is wptexturize which includes a number of other transforms too. You can disable wptexturize completely with add_filter( ‘run_wptexturize’, ‘__return_false’ ); which you can put in your child theme’s functions.php, or in a one-file plugin or similar. I can’t see a way to disable just these rules specifically.

Uploading images via ACF update_field function

Should anyone come across the same issue, I found that when creating the $gallery_data array I was creating an array of arrays instead of key value pairs, I ended up just running the update_field function inside a foreach with the add_image key value pair created. $gallery_img_id = rudr_upload_file_by_url($gallery_img[“original_path”]); $acf_gallery_slug = “gallery_image_” . $counter; $add_image = … Read more