Set Default Page On Customizer Live Preview

The default URL being previewed is home_url( “https://wordpress.stackexchange.com/” ). When no url query parameter is present when opening customize.php, this is the preview URL that is used. You can override the previewed URL when there is no url query parameter to supply a different default using something like this: add_action( ‘customize_controls_init’, function() { global $wp_customize; … Read more

WP customizer + gulp + browsersync = refused to display in iframe?

Found a work around by adding ‘ localhost:3000’ to the ‘Content-Security-Policy’ header: function edit_customizer_headers () { function edit_csp_header ($headers) { $headers[‘Content-Security-Policy’] .= ‘ localhost:3000’; return $headers; } add_filter(‘wp_headers’, ‘edit_csp_header’); } add_action(‘customize_preview_init’, ‘edit_customizer_headers’);

What is the difference between sanitize_text_field() and wp_filter_nohtml_kses()?

What Do They Do? wp_filter_nohtml_kses strips all HTML from a string, that’s it. It does it via the wp_kses function and it expects slashed data, here’s its implementation: function wp_filter_nohtml_kses( $data ) { return addslashes( wp_kses( stripslashes( $data ), ‘strip’ ) ); } sanitize_text_field on the other hand does more than that, the doc says: … Read more

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