This topic has 2 replies, 2 voices, and was last updated 9 years by Abe.

  • Author

    Tagged: ,

  • #58391

    /**
    * Defines the url to which is used to load local resources.
    * This may need to be filtered for local Window installations.
    * If resources do not load, please check the wiki for details.
    */
    /*
    if (strtoupper(substr(PHP_OS, 0, 3)) === ‘WIN’) {
    //winblows
    define( ‘KLEO_META_BOX_URL’, trailingslashit( str_replace( DIRECTORY_SEPARATOR, ‘/’, str_replace( str_replace( ‘/’, DIRECTORY_SEPARATOR, WP_CONTENT_DIR ), WP_CONTENT_URL, dirname(__FILE__) ) ) ) );

    } else {
    define( ‘KLEO_META_BOX_URL’, apply_filters( ‘cmb_meta_box_url’, trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) ) ) ) );
    }
    */

    /* This will resolve the SSL complaints breaking the meta boxes while in admin */
    define( ‘KLEO_META_BOX_URL’, apply_filters( ‘cmb_meta_box_url’, preg_replace(‘/http.*\:/’, ”, trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) ) ) ) ) );

    #58576
     Abe
    Keymaster

    Hi there. Thanks for the suggestion. Will definitely check it out and implement it

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #58583
     Abe
    Keymaster

    here is a better way. Thank you for the suggestion

    COPY CODE
    
    define( 'KLEO_META_BOX_URL', kleo_get_meta_box_url() );
    function kleo_get_meta_box_url() {
    		if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
    			// Windows
    			$content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );
    			$content_url = str_replace( $content_dir, WP_CONTENT_URL, dirname(__FILE__) );
    			$cmb_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );
    		} else {
    		  $cmb_url = str_replace(
    				array(WP_CONTENT_DIR, WP_PLUGIN_DIR),
    				array(WP_CONTENT_URL, WP_PLUGIN_URL),
    				dirname( __FILE__ )
    			);
    		}
    		$cmb_url = set_url_scheme( $cmb_url );
    		return trailingslashit( apply_filters('cmb_meta_box_url', $cmb_url ) );
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

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

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?