views/noticias/wp-content/plugins/gutentor/includes/sidebar-widget/class-reusable-block-widget.php
/**

         * Function to Creating widget front-end. This is where the action happens

         *

         * @access public

         * @since 1.0

         *

         * @param array $args widget setting

         * @param array $instance saved values

         * @return void

         *

         */
Function to Creating widget front-end. This is where the action happens



@param array $args widget setting
@param array $instance saved values
@return void
Function to Creating widget front - end . This is where the action happens @param array $args widget setting @param array $instance saved values @return void
public function widget($args, $instance) {
            $instance       = wp_parse_args( (array) $instance, $this->defaults);
            $title          = apply_filters( 'widget_title', !empty( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base );
            $wp_block_id    = absint( $instance[ 'wp_block_id' ] );
            echo $args['before_widget'];
            if( !empty( $title ) ) {
                echo $args['before_title'] .esc_html( $title ).$args['after_title'];
            }
            if( !empty ( $wp_block_id ) ) :
                $g_args = array(
                    'p'                     => $wp_block_id,
                    'post_type'           => 'wp_block',
                );
                $g_query = new WP_Query( $g_args );
                if ( $g_query->have_posts() ):
                    echo '<div class="gutentor-widget gutentor-wp-block-widget">';
                    while( $g_query->have_posts() ):$g_query->the_post();
                        $style = get_post_meta(get_the_ID(),'gutentor_dynamic_css',true);
                        echo "<!-- Dynamic CSS -->\n<style type=\"text/css\">\n" . wp_strip_all_tags(wp_kses_post($style)) . "\n</style>";
                        the_content();
                    endwhile;
                    echo '</div>';
                endif;
                wp_reset_postdata();
            endif;
            echo $args['after_widget'];
        }
public function widget ( $ args , $ instance ) { $ instance = wp_parse_args ( ( array ) $ instance , $ this -> defaults ) ; $ title = apply_filters ( 'widget_title' , ! empty ( $ instance [ 'title' ] ) ? $ instance [ 'title' ] : '' , $ instance , $ this -> id_base ) ; $ wp_block_id = absint ( $ instance [ 'wp_block_id' ] ) ; echo $ args [ 'before_widget' ] ; if ( ! empty ( $ title ) ) { echo $ args [ 'before_title' ] . esc_html ( $ title ) . $ args [ 'after_title' ] ; } if ( ! empty ( $ wp_block_id ) ) : $ g_args = array ( 'p' => $ wp_block_id , 'post_type' => 'wp_block' , ) ; $ g_query = new WP_Query ( $ g_args ) ; if ( $ g_query -> have_posts ( ) ) : echo '<div class="gutentor-widget gutentor-wp-block-widget">' ; while ( $ g_query -> have_posts ( ) ) : $ g_query -> the_post ( ) ; $ style = get_post_meta ( get_the_ID ( ) , 'gutentor_dynamic_css' , true ) ; echo " <!-- Dynamic CSS --> \n <style type= \" text/css \" > \n " . wp_strip_all_tags ( wp_kses_post ( $ style ) ) . " \n </style> " ; the_content ( ) ; endwhile ; echo '</div>' ; endif ; wp_reset_postdata ( ) ; endif ; echo $ args [ 'after_widget' ] ; }
Function to Creating widget front-end.
Function to Creating widget front - end .
/*default values*/ /*The Loop*/