Is it possible to remove the filter from 4.8 text widget?

We now have a new filter widget_text_content introduced in 4.8 src, with the following default callbacks: add_filter( ‘widget_text_content’, ‘capital_P_dangit’, 11 ); add_filter( ‘widget_text_content’, ‘wptexturize’ ); add_filter( ‘widget_text_content’, ‘convert_smilies’, 20 ); add_filter( ‘widget_text_content’, ‘wpautop’ ); that are applied if the filter settings, for the widget instance, is set to ‘content’. When you remove the filter settings … Read more

How to build widget with arrays inside arrays?

get_field_id prepare prefix for field id, within one widget instance it’s always the same. Your form fields probably look similar to these: // — $element[0] — // $field[icontxt] <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][0]” value=”%4$s”> // $field[iconlnk] <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][0]” value=”%4$s”> //$field[iconlnktrgt] <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][0]” value=”%4$s”> // — $element[1] — <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][1]” value=”%4$s”> … Read more

How to Validate Widget Input

If you are using the Widget API then declare your widget as a class which extends WP_Widget class and there you can define an upadte function where you can do your validation, the codex as a nice example of doing just that.

Determining a Widget Instance and Sidebar Location?

The widget_display_callback hook takes 3 arguments as we can see in /wp-includes/widgets.php: (line 180, WP 3.4.2) $instance = apply_filters(‘widget_display_callback’, $instance, $this, $args); So, to make a complete hook, the code is: // Priority = 10 // Arguments = 3 add_filter(‘widget_display_callback’, ‘wpse_57546_widget_display_callback’, 10, 3); // Using “$this” as an argument produces errors, // as it is … Read more

Can I display the widget admin in the page admin?

If I understand well your want to show the widgets adding and removing interface inside a meta box. An easy, -a little dirty- way is using an iframe: function metaboxed_widgets_admin() { if ( ! current_user_can( ‘edit_theme_options’ ) ) return; add_meta_box(‘metaboxed_widgets’, __(‘Widgets’), ‘metaboxed_widgets_admin_cb’, ‘page’); } add_action( ‘add_meta_boxes’, ‘metaboxed_widgets_admin’ ); function metaboxed_widgets_admin_cb() { if ( ! current_user_can( … Read more

How to add a filter to all widget output

There is another thread on here that discusses a workaround. Well… the familiar php workaround when a function does not provide a “get to variable” output actually… use ob_start: http://php.net/manual/en/function.ob-start.php to just capture the output and manipulate it before sending it on its way. Leads on stackoverflow: https://stackoverflow.com/search?q=%2Bwordpress+sidebar+%2Bob-start+

What is this instance variable doing in the Widgets class

$instance holds the data stored for this widget instance as an array. You could use the same widget multiple times, and each would get different data. get_field_name() and get_field_id() returns name/id attributes for that widget. They are unique for each widget, but do not depend on the data. That’s why they do not have to … Read more

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