inc2734 / wp-awesome-widgets
A library to add some awesome widgets for WordPress.
Installs: 7 136
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 4
Requires
- php: >=7.4
- inc2734/wp-adsense: ^1.0
- inc2734/wp-contents-outline: ^5.1
- inc2734/wp-plugin-view-controller: ^1.1
- inc2734/wp-profile-box: ^2.3
Requires (Dev)
- dev-master
- 16.0.3
- 16.0.2
- 16.0.1
- 16.0.0
- 15.0.0
- 14.1.2
- 14.1.1
- 14.1.0
- 14.0.6
- 14.0.5
- 14.0.4
- 14.0.3
- 14.0.2
- 14.0.1
- 14.0.0
- 13.0.2
- 13.0.1
- 13.0.0
- 12.3.3
- 12.3.1
- 12.3.0
- 12.2.3
- 12.2.2
- 12.2.1
- 12.2.0
- 12.1.6
- 12.1.5
- 12.1.4
- 12.1.3
- 12.1.2
- 12.1.1
- 12.1.0
- 12.0.1
- 12.0.0
- 11.2.0
- 11.1.0
- 11.0.6
- 11.0.5
- 11.0.4
- 11.0.3
- 11.0.2
- 11.0.1
- 10.0.1
- 10.0.0
- 9.1.4
- 9.1.3
- 9.1.2
- 9.1.1
- 9.1.0
- 9.0.0
- 8.3.1
- 8.3.0
- 8.2.0
- 8.1.1
- 8.1.0
- 8.0.3
- 8.0.2
- 8.0.0
- 7.1.0
- 7.0.2
- 7.0.1
- 6.0.2
- 6.0.1
- 6.0.0
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.3.9
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.3
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.11.6
- 1.11.5
- 1.11.4
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.11
- 1.9.10
- 1.9.9
- 1.9.8
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-dependabot/npm_and_yarn/webpack-5.76.1
- dev-dependabot/npm_and_yarn/http-cache-semantics-4.1.1
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/loader-utils-2.0.4
- dev-inc2734-patch-1
This package is auto-updated.
Last update: 2024-11-06 00:26:14 UTC
README
Widgets
- PR Box
- Slider (slick)
- Pickup slider (slick)
- Showcase
- Site branding (Displaying the Logo)
- Recent posts
- Any posts
- Ranking (Self updating)
- Taxonomy posts
- Contents outline
- Profile box
- Carousel (Any posts)
- Local navigation
Install
$ composer require inc2734/wp-awesome-widgets
How to use
<?php
new \Inc2734\WP_Awesome_Widgets\Bootstrap();
How to overwite widget templates
You can overwite the widget template. For example,
$ cd wp-content/your-theme
$ mkdir -p templates/widget
$ cp vendor/inc2734/wp-awesome-widgets/src/widget/slider/_widget.php templates/widget/slider.php
$ vi templates/widget/slider.php
Filter hooks
/**
* Customize widget options
* @param array $widget_options
* @param string The widget class name
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_widget_options',
function( $widget_options, $classname ) {
return $widget_options;
},
10,
2
);
inc2734_wp_awesome_widgets_recent_posts_widget_args
/**
* Customize recent posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_recent_posts_widget_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_recent_posts_widget_args_<$widget_number>
/**
* Customize specific recent posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_recent_posts_widget_args_'. $widget_number,
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_ranking_widget_args
/**
* Customize ranking widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_ranking_widget_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_ranking_widget_args_<$widget_number>
/**
* Customize specific ranking widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_ranking_widget_args_' . $widget_number,
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_carousel_any_posts_widget_args
/**
* Customize carousel any posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_carousel_any_posts_widget_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_carousel_any_posts_widget_args_<$widget_number>
/**
* Customize specific carousel any posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_carousel_any_posts_widget_args_'. $widget_number,
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_carousel_image_size
/**
* Customize carousel image size
*
* @param string $image_size
* @param boolean $is_mobile
* @param numeric $widget_id
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_carousel_image_size',
function( $image_size, $is_mobile, $widget_id ) {
return $image_size;
},
10,
3
);
inc2734_wp_awesome_widgets_any_posts_widget_args
/**
* Customize any posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_any_posts_widget_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_any_posts_widget_args_<$widget_number>
/**
* Customize specific any posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_any_posts_widget_args_' . $widget_number,
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_showcase_backgroud_image_size
/**
* Customize showcase widget background image size
*
* @param string $image_size
* @param boolean $is_mobile
* @param numeric $widget_id
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_showcase_backgroud_image_size',
function( $image_size, $is_mobile, $widget_id ) {
return $image_size;
},
10,
3
);
inc2734_wp_awesome_widgets_showcase_image_size
/**
* Customize showcase widget image size
*
* @param string $image_size
* @param boolean $is_mobile
* @param numeric $widget_id
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_showcase_image_size',
function( $image_size, $is_mobile, $widget_id ) {
return $image_size;
},
10,
3
);
inc2734_wp_awesome_widgets_widget_templates
/**
* Customize custom widget template slug (directory)
*
* @param string $slug
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_widget_templates',
function( $slug ) {
return $slug;
}
);
inc2734_wp_awesome_widgets_render_widget
/**
* Customzie widget html
*
* @param string $html
* @param array $widget_args
* @param array $instance
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_render_widget',
function( $html, $widget_args, $instance ) {
return $html;
},
10,
3
);
inc2734_wp_awesome_widgets_taxonomy_posts_widget_args
/**
* Customzize taxonomy posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_taxonomy_posts_widget_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_taxonomy_posts_widget_args_<$widget_number>
/**
* Customize specific taxonomy posts widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_taxonomy_posts_widget_args_' . $widget_number,
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_pickup_slider_widget_args
/**
* Customize pickup slider widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_pickup_slider_widget_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_pickup_slider_widget_args_<$widget_number>
/**
* Customize specific pickup slider widget args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_pickup_slider_widget_args_' . $widget_number,
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_pickup_slider_image_size
/**
* Customize pickup slider widget image size
*
* @param string $image_size
* @param boolean $is_mobile
* @param numeric widget_id
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_pickup_slider_image_size',
function( $image_size, $is_mobile, $widget_id ) {
return $image_size;
},
10,
3
);
inc2734_wp_awesome_widgets_child_nav_args
/**
* Customize child nav args
*
* @param array $query_args
* @return array
*/
add_filter(
'inc2734_wp_awesome_widgets_child_nav_args',
function( $query_args ) {
return $query_args;
}
);
inc2734_wp_awesome_widgets_posts_list_image_size
/**
* Customize posts list widget (recent posts, ranking any posts) image size
*
* @param string $image_size
* @param boolean $is_mobile
* @param numeric widget_id
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_posts_list_image_size',
function( $image_size, $is_mobile, $widget_id ) {
return $image_size;
},
10,
3
);
inc2734_wp_awesome_widgets_view_args
/**
* @param array $args
* @var string $slug
* @var string $name
* @var array $vars
* @param array
*/
add_filter(
'inc2734_wp_awesome_widgets_view_args',
function( $args ) {
return $args;
}
);
inc2734_wp_awesome_widgets_view_render
/**
* @param string $html
* @param string $slug
* @param string $name
* @param array $vars
* @return string
*/
add_filter(
'inc2734_wp_awesome_widgets_view_render',
function( $html, $slug, $name, $vars ) {
return $html;
},
10,
4
);
Action hooks
inc2734_wp_awesome_widgets_before_admin_enqueue_scripts
inc2734_wp_awesome_widgets_after_admin_enqueue_scripts
inc2734_wp_awesome_widgets_view_pre_render
/**
* @param array $args
* @var string $slug
* @var string $name
* @var array $vars
*/
add_action(
'inc2734_wp_awesome_widgets_view_pre_render',
function( $args ) {
}
);
inc2734_wp_awesome_widgets_view_post_render
/**
* @param array $args
* @var string $slug
* @var string $name
* @var array $vars
*/
add_action(
'inc2734_wp_awesome_widgets_view_post_render',
function( $args ) {
}
);
inc2734_wp_awesome_widgets_view_<slug>
/**
* @param string $name
* @param array $vars
*/
add_action(
'inc2734_wp_awesome_widgets_view_<slug>',
function( $name, $vars ) {
?>
HTML
<?php
},
10,
2
);
inc2734_wp_awesome_widgets_view_<slug>-<name>
/**
* @param array $vars
*/
add_action(
'inc2734_wp_awesome_widgets_view_<slug>-<name>',
function( $vars ) {
?>
HTML
<?php
}
);