395263efcbe0b5a649a893da911b6d569dda9018
3 Plugin Name: Site Plugin for danix.xyz
4 Description: Site specific code changes for danix.xyz
5 Plugin URI: https://danix.xyz
7 Author: Danilo 'danix' Macri
8 Author URI: https://danix.xyz
12 * Disable admin bar sitewide
14 show_admin_bar( __return_false() );
17 * Allow Shortcodes inside the html widget
19 //add_filter( 'widget_text', 'do_shortcode' );
22 * make sure the links menu in the admin is visible
24 add_filter( 'pre_option_link_manager_enabled', '__return_true' );
27 * The gravatar shortcode
29 * @param email $email email address used to retrieve the gravatar image
30 * @return string HTML the image tag which will display the gravatar image.
33 function danix_gravatar( $atts ) {
46 if ( empty( $email ) ) {
50 $output = get_avatar( $email, $size, $default, $alt );
54 add_shortcode( 'gravatar', 'danix_gravatar' );
57 * Added baguette.js to display a lightbox for images and galleries
59 function baguette_register_assets() {
60 wp_register_script( 'baguettebox', plugin_dir_url( __FILE__
) . '/baguette/baguetteBox.min.js', array(), '1.11.1', true );
61 wp_register_script( 'baguetteload', plugin_dir_url( __FILE__
) . '/baguette/baguetteLoad.js', array(), '1.11.1', true );
62 wp_register_style( 'baguettebox-css', plugin_dir_url( __FILE__
) . '/baguette/baguetteBox.min.css', array(), '1.11.1' );
64 add_action( 'wp_enqueue_scripts', 'baguette_register_assets' );
66 function baguette_enqueue_assets() {
67 if ( has_block( 'gallery' ) ||
has_block( 'image' ) ) {
68 wp_enqueue_script( 'baguettebox' );
69 wp_enqueue_script( 'baguetteload' );
70 wp_enqueue_style( 'baguettebox-css' );
73 add_action( 'wp_enqueue_scripts', 'baguette_enqueue_assets' );
76 * Do not translate smileys into emoticons.
78 add_filter( 'option_use_smilies', '__return_false' );