wp_signon always passed the password eventhough password is wrong

The wp_signon function is probably working exactly as it is supposed to. What you’re missing is that that other methods of authentication exist, like the browser cookies, and wp_signon will check those too. Is your browser sending your WordPress authentication cookies to your script? The bottom line is that you should not be using wp_signon … Read more

Detect a focus on wp_editor

You can pass an array of settings to the editor instance. For possible values please refer to the tinymce documentation, in your case ‘init_instance_callback’ might be helpful. https://www.tinymce.com/docs/configure/integration-and-setup/#init_instance_callback wp_editor(”, ‘sedemoeditor’, array( ‘tinymce’ => array( ‘init_instance_callback’ => ‘function(editor) { editor.on(“focus”, function(){ console.log(“Editor: ” + editor.id + ” focus.”); }); }’ ) ));

Get the php template file from other theme folder

You can filter the template with the template_include filter. This example will filter the archive template for all archive pages. If you need to do this for a specific archive, use is_post_type_archive( $post_types ) as your condition. Put this in your functions.php file of your child theme. function my_archive_filter( $template) { if ( is_archive() ) … Read more

Static Frontpage Pagination – Custom loop

Please, update your loop part with following code: <?php $page = (get_query_var(‘page’) ? get_query_var(‘page’) : 1); $args=array(‘post_type’ => ‘gadget’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 36, ‘page’ => $page); $wp_query = new WP_Query($args); if( $wp_query->have_posts() ) { $i = 0; while ($wp_query->have_posts()) : $wp_query->the_post(); $postidlt = $post->ID; Reason before using page instead of paged. page (int) … Read more

Site Title and Tagline in Theme Options Page

The framework offers a filter for validating input values inside the optionsframework_validate function. Just for reference, here’s the relevant part from the file wp-content/themes/your-theme/inc/options-framework.php: /** * Validate Options. * * This runs after the submit/reset button has been clicked and * validates the inputs. */ function optionsframework_validate( $input ) { /* code */ $clean[$id] = … Read more

Add post class to the TinyMCE iframe?

The filter you’re after is tiny_mce_before_init. Using this, we can hook into TinyMCE’s ‘init_array’ and add body classes: add_filter( ‘tiny_mce_before_init’, ‘wpse_235194_tiny_mce_classes’ ); function wpse_235194_tiny_mce_classes( $init_array ){ global $post; if( is_a( $post, ‘WP_Post’ ) ){ $init_array[‘body_class’] .= ‘ ‘ . join( ‘ ‘, get_post_class( ”, $post->ID ) ); } return $init_array; } We’re joining the post … Read more