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
/** | |
* Trim text, strip shortcodes and excerpt return | |
* | |
* @param Int $post - Post ID (optional) | |
* @param String $text - Text or get_the_conten() (optional) | |
* @param Int $words - Number of words to return | |
* | |
* @return string - "Ex: This is my text trim and..." | |
* | |
* Use: echo custom_trim_excerpt($post_id, '', 20 ); |
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
<?php | |
function hwid_acf_admin_footer() { | |
?> | |
<script> | |
( function( $) { | |
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id ) { | |
// grab the classes defined within the field admin and put them in an array | |
var classes = $( '#' + id ).closest( '.acf-field-wysiwyg' ).attr( 'class' ); |