This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $wpdb; | |
| $tablename = $wpdb->prefix . 'fictizia_clientes'; | |
| $charset_collate = ''; | |
| if ( ! empty($wpdb->charset) ) | |
| $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; | |
| if ( ! empty($wpdb->collate) ) | |
| $charset_collate .= " COLLATE $wpdb->collate"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Fictizia_Widget extends WP_Widget { | |
| // El nombre de la clase tiene que coincidir con esta función | |
| function Fictizia_Widget() { | |
| // Argumentos | |
| $args = array( 'classname' => 'fictizia-widget', 'description' => __( 'Fictizia Widget Description', 'fictizia' ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function widget( $args, $instance ) { | |
| extract( $args ); | |
| $title = apply_filters( 'widget_title', $instance['title'] ); | |
| ?> | |
| <?php echo $before_widget; ?> | |
| <?php if ( $title ) | |
| echo $before_title . $title . $after_title; ?> | |
| Hola, mundo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function widget( $args, $instance ) { | |
| $title = apply_filters( 'widget_title', $instance['title'] ); | |
| ?> | |
| <?php echo $args['before_widget']; ?> | |
| <?php if ( $title ) | |
| echo $args['before_title'] . $title . $args['after_title']; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function update( $new_instance, $old_instance ) { | |
| $instance = $old_instance; | |
| $title = sanitize_text_field( $new_instance['title'] ); | |
| if ( ! empty( $title ) ) | |
| $instance['title'] = $title; | |
| return $instance; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function form( $instance ) { | |
| $defaults = array( | |
| 'title' => 'Fictizia Widget' | |
| ); | |
| $instance = wp_parse_args( $instance, $defaults ); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function form($instance) { | |
| ?> | |
| <p> | |
| <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> | |
| <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="" /> | |
| </label> | |
| </p> | |
| <?php | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Fictizia_Widget extends WP_Widget { | |
| // El nombre de la clase tiene que coincidir con esta función | |
| function Fictizia_Widget() { | |
| // Argumentos | |
| $args = array( 'classname' => 'fictizia-widget', 'description' => __( 'Fictizia Widget Description', 'fictizia' ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $args = array( | |
| 'ignore_sticky_posts' => true, | |
| 'posts_per_page' => $atts['items'], | |
| 'post_type' => 'post', | |
| 'post_status' => 'publish' | |
| ); | |
| $posts = get_posts( $args ); | |
| $html = '<ul>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'gettext', 'fictizia_change_strings', 10, 3 ); | |
| function fictizia_change_strings( $translate, $text, $domain ) { | |
| if ( $text === 'Custom Header' && $domain === 'default' ) { | |
| return 'Logotipo'; | |
| } | |
| return $translate; | |
| } |