cpu21
Forum Replies Created
-
I am also having the same problem.
The conditional logic of text snippets works perfectly, but the conditional logic of php snippets doesn’t.I’ll ask this to WP Offload Media as well.
Mircea Sandu, thank you very much for your help.
RegardsI found the plugin causing it!
That plugin is WP Offload Media. If I disable this plugin, WPCode saved snippets normally.
I am using WP Offload Media version 2.6.2, pro version.
* Pro Version: https://deliciousbrains.com/wp-offload-media/
I am currently serving images through Amazon CloudFront.
I don’t know the exact reason, but WP Offload Media is definitely the cause.
I took a screenshot of the WP Offload Media plugin options.
https://pn-gp.viewus.co.kr/ss_Offload_Media_options.jpgAnd if I enable WP Offload Media and do not write https or http, WPCode also saves snippets normally.
Here is full php snippets.
// Admin Login Logo function my_login_logo() { ?> <style type="text/css"> body.login div#login h1 a {background-image: url('https://fastreport.co.kr/wp-content/uploads/2022/07/auto_issue_logo.svg'); background-size: contain; width: 275px; height: 39px; margin-bottom: 32px;} </style> <?php } add_action( 'login_enqueue_scripts', 'my_login_logo' ); // Admin Login Logo URL function custom_loginlogo_url($url) { return 'https://fastreport.co.kr/'; } add_filter( 'login_headerurl', 'custom_loginlogo_url' ); // Admin Login Logo URL Title function my_login_logo_url_title() { return 'Go to fastreport.co.kr'; } add_filter( 'login_headertext', 'my_login_logo_url_title' ); // Yoast SEO Facebook Meta - unsupported WebP : Adding the Open Graph in the Language Attributes function add_opengraph_doctype( $output ) { return $output . ' xmlns:og="https://opengraphprotocol.org/schema/" xmlns:fb="https://www.facebook.com/2008/fbml"'; } add_filter('language_attributes', 'add_opengraph_doctype'); // Yoast SEO Facebook Meta - unsupported WebP : Add Open Graph Meta Info function insert_fb_in_head() { global $post; if ( !is_singular()) //if it is not a post or a page return; // echo '<meta property="fb:app_id" content="Your Facebook App ID" />'; // echo '<meta property="og:title" content="' . get_the_title() . '"/>'; // echo '<meta property="og:type" content="article"/>'; // echo '<meta property="og:url" content="' . get_permalink() . '"/>'; // echo '<meta property="og:site_name" content="Your Site NAME Goes HERE"/>'; if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image $default_image="https://fastreport.co.kr/wp-content/uploads/2022/07/auto_issue_home_featured_image.jpg"; echo '<meta property="og:image" content="' . $default_image . '"/>'; } else { $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); if ( wp_get_image_mime( $thumbnail_src[0] ) == 'image/webp' ) { echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>'; echo '<meta property="og:image:width" content="' . esc_attr( $thumbnail_src[1] ) . '"/>'; echo '<meta property="og:image:height" content="' . esc_attr( $thumbnail_src[2] ) . '"/>'; echo '<meta property="og:image:type" content="' . wp_get_image_mime( $thumbnail_src[0] ) . '"/>'; echo '<meta property="og:image:alt" content="' . get_the_title() . '"/>'; } } echo ""; } add_action( 'wp_head', 'insert_fb_in_head', 5 );
it works fine!
What is the problem, and why is this happening?Yes I am using version 2.0.1.
I linked the screenshot.
Please check in order.1. Before Editing : https://pn-gp.viewus.co.kr/ss_WPCode1.jpg
2. Editing : https://pn-gp.viewus.co.kr/ss_WPCode2.jpg
3. After editing (after save) : https://pn-gp.viewus.co.kr/ss_WPCode3.jpg