WordPress Widget Not Saving Instance

The problem is your update function. $old_instance is kind of special variable. The simplest is function update($new_instance, $old_instance) { return $new_instance; } For the safe function update($new_instance, $old_instance) { $instance = array(); $instance[‘name’] = htmlentities($new_instance[‘name’]); $instance[‘divclass’] = htmlentities($new_instance[‘divclass’]); $instance[‘paypal’] = htmlentities($new_instance[‘paypal’]); return $instance; }

How to add custom tinymce plugin to new text widget

I found the solution with help from Jacob Peattie and the article from https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/ Here’s a quick walkthrough on what i did: I made a new js file container the code of my original button, but modified it to the event listener of the widget tinymce jQuery( document ).on( ‘tinymce-editor-setup’, function( event, editor ) { … Read more

Widget Text Needs to be White [closed]

Without seeing the code it’s a difficult problem to solve, but it sounds like something else is overwriting your code. You may need to be more specific about the H4 you’re targeting footer h4 for instance. You may also need to add !important to your CSS declaration in order to get it to work. See … Read more

Can’t Write Custom Widget Code In One ECHO

Technically your first example is also incorrect, but the problem is not apparent. You’re using template tags that themselves echo their content. For example, you can write simply: the_permalink(); without echo, and the permalink will be output. This is because that function echoes its value. To output the permalink within an echo or variable assignment … Read more

Widget back end radio button issue

You got that problem because the radio buttons have different name; i.e. the_style_1 and the_style_2. So I’d suggest you to use the_style as the name for both the radio buttons: <p> <input class=”radio” type=”radio” <?php checked( $instance[ ‘the_style’ ], ‘style_1’ ); ?> id=”<?php echo $this->get_field_id( ‘the_style_1’ ); ?>” name=”<?php echo $this->get_field_name( ‘the_style’ ); ?>” value=”style_1″ … Read more

How to make widget title accept php?

You can use the filter widget_title and a “virtual” shortcode. Of course, as One Trick Pony points out, the “why” (and the “what”) is essential to find a proper solution… Supposing the widget title was Title [php] More Title: add_filter( ‘widget_title’, ‘pseudo_php_wpse_90360’, 10, 3 ); function pseudo_php_wpse_90360( $title, $instance, $id_base ) { if( FALSE === … Read more

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