Error Warning Removed by adding one line of code
In the code of the class SiteOrigin_Widget_Field_Link
add the line in red to remove a warning, could you include this correction in your code for future updates ?
/**
* Class SiteOrigin_Widget_Field_Link
*/
class SiteOrigin_Widget_Field_Link extends SiteOrigin_Widget_Field_Text_Input_Base {
/**
* An array of post types to use in the query for posts when the ‘Select Content’ button is clicked.
*
* @access protected
* @var array
*/
protected $post_types;
protected function render_before_field( $value, $instance ) {
parent::render_before_field( $value, $instance );
if(!is_array($this->post_types)) $this->post_types=array();
?>
<input type="text" class="content-text-search"
data-post-types="post_types ) ) ?>”
placeholder=””/>
<?php
parent::render_after_field( $value, $instance );
}
protected function sanitize_field_input( $value, $instance ) {
$sanitized_value = trim( $value );
if ( preg_match( '/^post: *([0-9]+)/', $sanitized_value, $matches ) ) {
$sanitized_value = 'post: ' . $matches[1];
} else {
$sanitized_value = sow_esc_url_raw( $sanitized_value );
}
return $sanitized_value;
}
}
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
1Thanks for the recommendation Arnaud. I’ve implemented something like this in the development version. It’ll be available in the next update.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.