6db6576c61a8a0d998c04f11b2111a058944b2e0
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 ) {
34 extract(shortcode_atts(array(
44 $output = get_avatar($email, $size, $default, $alt);
48 add_shortcode('gravatar', 'danix_gravatar');
51 * The download button shortcode
53 * @param url $link link address.
54 * @param string $linkname text that will be displayed by the button.
55 * @return string HTML the link tag that will be rendered to the page.
58 function danix_download_button( $atts ) {
59 extract(shortcode_atts(array(
68 '<a href="%s" class="download_button">%s</a>',
75 add_shortcode('download', 'danix_download_button');
78 * The google analytics code
81 function danix_google_anal() {
82 if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) { ?
>
83 <!-- Global site
tag (gtag
.js
) - Google Analytics
-->
84 <script async src
="https://www.googletagmanager.com/gtag/js?id=UA-23882460-1"></script
>
86 window
.dataLayer
= window
.dataLayer ||
[];
87 function gtag(){dataLayer
.push(arguments
);}
88 gtag('js', new Date());
90 gtag('config', 'UA-23882460-1');
94 add_action('wp_head', 'danix_google_anal', 10);
97 * The googlemaps shortcode
99 * @param width the width of the returned map
100 * @param height the height of the returned map
101 * @param src the url of the map you want to display
102 * @return string HTML the map object
106 function danix_gmaps($atts, $content = null) {
107 extract(shortcode_atts(array(
112 return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&output=embed" ></iframe>';
114 add_shortcode("googlemaps", "danix_gmaps");
117 * Add Next Page / Page Break button
118 * inside the WordPress Visual Editor
120 * @link https://shellcreeper.com/?p=889
124 function danix_next_page_button( $buttons, $id ) {
126 /* only add this for content editor */
127 if ( 'content' != $id )
130 /* add next page after more tag button */
131 array_splice( $buttons, 13, 0, 'wp_page' );
135 /* Add Next Page Button on the First Row */
136 add_filter( 'mce_buttons', 'danix_next_page_button', 1, 2 ); // 1st row