This file contains hidden or 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
/* For usage with acf_form() */ | |
function my_acf_wysiwyg_character_counter() { | |
?> | |
<script type="text/javascript"> | |
acf.add_filter('wysiwyg_tinymce_settings', function(mceInit) { | |
mceInit.elementpath = false; | |
mceInit.setup = function(ed) { | |
var characterLimit = 800, | |
edContainer, |
This file contains hidden or 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('pre_get_posts', 'posts_for_current_author'); | |
function posts_for_current_author($query) { | |
if(!is_admin()) { return $query; } | |
global $pagenow; | |
if( 'upload.php' == $pagenow || !$query->is_admin ) { | |
if( !current_user_can( 'edit_others_posts' ) ) { |
This file contains hidden or 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
/** | |
* ACF Pro repeater field shortcode | |
* | |
* I created this shortcode function because it didn't exist and it was being requested by others | |
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/ | |
* | |
* @attr {string} field - (Required) the name of the field that contains a repeater sub group | |
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group | |
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc | |
*/ |