This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'amp_post_template_analytics', 'xyz_amp_add_custom_analytics' ); | |
function xyz_amp_add_custom_analytics( $analytics ) { | |
if ( ! is_array( $analytics ) ) { | |
$analytics = array(); | |
} | |
// https://developers.google.com/analytics/devguides/collection/amp-analytics/ | |
$analytics['xyz-googleanalytics'] = array( | |
'type' => 'googleanalytics', | |
'attributes' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="fb-quote"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/zh_TW/sdk.js#xfbml=1&version=v2.6"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( current_user_can('contributor') && !current_user_can('upload_files') ) | |
add_action('admin_init', 'allow_contributor_uploads'); | |
function allow_contributor_uploads() { | |
$contributor = get_role('contributor'); | |
$contributor->add_cap('upload_files'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('mce_buttons','wysiwyg_editor'); | |
function wysiwyg_editor($mce_buttons) { | |
$pos = array_search('wp_more',$mce_buttons,true); | |
if ($pos !== false) { | |
$tmp_buttons = array_slice($mce_buttons, 0, $pos+1); | |
$tmp_buttons[] = 'wp_page'; | |
$mce_buttons = array_merge($tmp_buttons, array_slice($mce_buttons, $pos+1)); | |
} | |
return $mce_buttons; | |
} |
NewerOlder