3 Plugin Name: Site Plugin for danixland.net
4 Description: Site specific code changes for danixland.net
8 * Disable admin bar sitewide
10 show_admin_bar(__return_false());
13 * Allow Shortcodes inside the html widget
15 add_filter( 'widget_text', 'do_shortcode' );
18 * make sure the links menu in the admin is visible
20 add_filter( 'pre_option_link_manager_enabled', '__return_true' );
23 * The gravatar shortcode
25 * @param email $email email address used to retrieve the gravatar image
26 * @return string HTML the image tag which will display the gravatar image.
29 function danix_gravatar( $atts ) {
30 extract(shortcode_atts(array(
40 $output = get_avatar($email, $size, $default, $alt);
44 add_shortcode('gravatar', 'danix_gravatar');
47 * The download button shortcode
49 * @param url $link link address.
50 * @param string $linkname text that will be displayed by the button.
51 * @return string HTML the link tag that will be rendered to the page.
54 function danix_download_button( $atts ) {
55 extract(shortcode_atts(array(
64 '<a href="%s" class="download_button">%s</a>',
71 add_shortcode('download', 'danix_download_button');
74 * The google analytics code
77 function danix_google_anal() {?
>
78 <!-- Global site
tag (gtag
.js
) - Google Analytics
-->
79 <script async src
="https://www.googletagmanager.com/gtag/js?id=UA-23882460-1"></script
>
81 window
.dataLayer
= window
.dataLayer ||
[];
82 function gtag(){dataLayer
.push(arguments
);}
83 gtag('js', new Date());
85 gtag('config', 'UA-23882460-1');
88 add_action('wp_head', 'danix_google_anal', 10);
91 * The googlemaps shortcode
93 * @param width the width of the returned map
94 * @param height the height of the returned map
95 * @param src the url of the map you want to display
96 * @return string HTML the map object
100 function danix_gmaps($atts, $content = null) {
101 extract(shortcode_atts(array(
106 return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&output=embed" ></iframe>';
108 add_shortcode("googlemaps", "danix_gmaps");