Created
December 8, 2017 18:01
-
-
Save hellofromtonya/1e814c0c0852eda1633b71e49623b68d to your computer and use it in GitHub Desktop.
Change `>>` to `...` after "Continue reading" in the Beans framework
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
<?php | |
/** | |
* This line of code removes the >> HTML markup, meaning this HTML will not be sent out to the browser: | |
* | |
* <i class="uk-icon-angle-double-right uk-margin-small-left" data-markup-id="beans_next_icon[_more_link]"></i> | |
*/ | |
beans_remove_markup('beans_next_icon[_more_link]'); | |
/** | |
* Next, we register our callback to the "beans_post_more_link_text_output" filter. This gives us a | |
* "hook" to change the text. We can then append our "..." after the "Continue reading" text. | |
*/ | |
beans_add_filter('beans_post_more_link_text_output', 'add_dots_after_continue_reading' ); | |
/** | |
* Add ... after the "Continue reading" text. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $continue_reading_text "Continue reading" textual string. | |
* | |
* @return string | |
*/ | |
function add_dots_after_continue_reading($continue_reading_text) { | |
return $continue_reading_text . '...'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a note, you can also use
add_filter
instead ofbeans_add_filter
.