Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Last active December 5, 2024 19:23
Show Gist options
  • Save codigoconjuan/2d85ef01cfb3b06ba0ce4d886ff6a925 to your computer and use it in GitHub Desktop.
Save codigoconjuan/2d85ef01cfb3b06ba0ce4d886ff6a925 to your computer and use it in GitHub Desktop.
Crear un Widget para WordPress
<?php
if(!defined('ABSPATH')) die();
class GymFitness_Clases_Widget extends WP_Widget {
function __construct() {
parent::__construct(
'gymfitness_widget',
esc_html__( 'GymFitness Clases', 'gymfitness' ),
array( 'description' => esc_html__( 'Agrega las Clases como Widget', 'gymfitness' ), )
);
}
public function widget( $args, $instance ) {
}
public function form( $instance ) {
}
public function update( $new_instance, $old_instance ) {
}
}
function gymfitness_registrar_widget() {
register_widget( 'GymFitness_Clases_Widget' );
}
add_action( 'widgets_init', 'gymfitness_registrar_widget' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment