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 WC_Settings_Hola_Dolly extends WC_Settings_Page { | |
public function __construct() { | |
$this->id = 'hola-dolly'; | |
$this->label = __( 'Hola Dolly', 'hola-dolly' ); | |
// Añadir pestaña | |
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
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 | |
public function display_special_field( $field ) { | |
$option_value = get_option( $field['id'], $field['default'] ); | |
?> | |
<label for="<?php echo $field['id']; ?>" ><?php echo esc_html( $field['title'] ); ?></label><br/> | |
<textarea name="<?php echo $field['id']; ?>" id="<?php echo $field['id']; ?>"><?php echo esc_textarea( $option_value ); ?></textarea> | |
<?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 WC_Settings_Hola_Dolly extends WC_Settings_Page { | |
public function __construct() { | |
$this->id = 'hola-dolly'; | |
$this->label = __( 'Hola Dolly', 'hola-dolly' ); | |
// Añadir pestaña | |
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
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
<form action="" method="POST"> | |
<p> | |
<label for="email"><?php _e( 'Email', 'ignacio' ); ?> | |
<input id="email" type="email" name="email" value="" /> | |
</label> | |
</p> | |
<p> | |
<label for="message"><?php _e( 'Message', 'ignacio' ); ?></label> | |
<textarea id="message" name="message"></textarea> | |
</p> |
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 | |
if ( post_password_required() ) | |
return; | |
?> | |
<div id="comments" class="comments-area"> | |
<?php if ( comments_open() && get_comments_number() ): ?> |
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; | |
} |
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
<?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 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 | |
function form( $instance ) { | |
$defaults = array( | |
'title' => 'Fictizia Widget' | |
); | |
$instance = wp_parse_args( $instance, $defaults ); | |
?> |