Support

Account

Forum Replies Created

  • John, I’ll need to do some searching around in the DB’s postmeta for my “product” post-types before I can comment on that. I wouldn’t think it’s possible, but who knows? If I find anything interesting I will definitely let you know!

    Tks,
    SH

  • Update: problem identified, workaround in place

    On a hunch, I deleted the two video fields which fetched videos from Youtube. Problem solved!

    There was NOTHING to indicate the problem came from them. The links to the videos were set up in a Product field, appearing as links like this one:

    https://www.youtube.com/watch?v=4GIk2Bp3FcA

    and these links all worked perfectly. But as soon as I deleted them from the Products, and removed all reference to them from the template that controlled how they appeared online, the Warning messages vanished. Go figure!

    The product pages now look fine (see this example: https://rolanditen.com/product/r8-mark-ii-sport-stainless-steel-red-gold/) but of course there are no more videos. On balance I think the client will prefer this to bug-causing video links; I’ll be informing them shortly.

    Any idea, John, what has happened between Youtube and ACF to create this phenomenon?

    Many thanks for your work so far, anyway.
    SH

  • OK – I commented out the shortcodes and that didn’t change anything.

    When you say
    “Without seeing the code of the other two files there isn’t any way for me to know. You could try commenting out the code in these files and see if that eliminates the error.”

    do you mean the other two files that do exactly the same thing, or the one that shows the Purchse button and the Elementor admin_functions.php? The other two that do the same thing just refer to different field_ids, and the Purchase button refers to yet another field_id.

    The admin_functions.php contains the following code:

    
    function hello_elementor_fail_load_admin_notice() {
    	// Leave to Elementor Pro to manage this.
    	if ( function_exists( 'elementor_pro_load_plugin' ) ) {
    		return;
    	}
    
    	$screen = get_current_screen();
    	if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
    		return;
    	}
    
    	if ( 'true' === get_user_meta( get_current_user_id(), '_hello_elementor_install_notice', true ) ) {
    		return;
    	}
    
    	$plugin = 'elementor/elementor.php';
    
    	$installed_plugins = get_plugins();
    
    	$is_elementor_installed = isset( $installed_plugins[ $plugin ] );
    
    	if ( $is_elementor_installed ) {
    		if ( ! current_user_can( 'activate_plugins' ) ) {
    			return;
    		}
    
    		$message = __( 'Hello theme is a lightweight starter theme designed to work perfectly with Elementor Page Builder plugin.', 'hello-elementor' );
    
    		$button_text = __( 'Activate Elementor', 'hello-elementor' );
    		$button_link = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin );
    	} else {
    		if ( ! current_user_can( 'install_plugins' ) ) {
    			return;
    		}
    
    		$message = __( 'Hello theme is a lightweight starter theme. We recommend you use it together with Elementor Page Builder plugin, they work perfectly together!', 'hello-elementor' );
    
    		$button_text = __( 'Install Elementor', 'hello-elementor' );
    		$button_link = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
    	}
    
    	?>

    plus some styling and some html containing various button links.

  • Hi John, and many thanks.

    Re: custom PHP code, I do have 3 tiny PHP files sitting in my child theme’s includes directory, each of which interrogates an ACF field, and based on the status of that field, returns a different value to the shortcode on the product webpage. The code these 3 files contain is simply this:

    <?php function ph_isSold_shortcode( $atts ) 
    {
    	/*$status = get_field('field_5fbfa6ddbe952');//the Sold? checkbox */
    	$status = get_field('sold_status');
     
    	if ($status)
    		return $status;
    }
    
    add_shortcode( 'soldornot', 'ph_isSold_shortcode' );

    ==================

    There is one like this for the Rare checkbox, and another for the “Just Arrived” checkbox. = 3 files

    A fourth file in this directory displays a “Send Purchase Enquiry” button if and only if the Sold checkbox has been set to “on”.

    There is a 5th file in this includes dir, but this comes from Elementor, is called admin_functions.php and does only this (documentation at top file):
    `<?php
    /**
    * Hello Elementor admin functions.
    *
    * @package HelloElementor
    */

    /**
    * Show in WP Dashboard notice about the plugin is not activated.
    *
    * @return void
    */
    … their code here.

    Would my 4 files be causing the warning messages, in your opinion?

    Many thanks!
    SH

  • Hi John, it seems I have access to it – it’s just that it isn’t accepted when I re-enter and save it! However, I did what you suggested, and now it’s fine.

    Thanks v much!

  • OK, I figured out how to make it work. Instead of a Message field-type I made it a Text field-type instead, and now it works.

Viewing 7 posts - 1 through 7 (of 7 total)