Hi
At the moment, there is only one way to achieve this.
If you are using version 1.x (from wordpress.org), you can use
add_filter('bsi_text', function($text) {
$text = explode('-', $text);
$text = trim($text[0]);
return $text;
});
If you are using version 2.x (from github) you can do the same thing, but with a different filter name.
add_filter('bsi_image_text', function($text) {
$text = explode('-', $text);
$text = trim($text[0]);
return $text;
});
Please note that the ‘-‘ in this code is not a simple dash, and it might even not be a dash in your website (as it depends on the settings of your website);
you can take this character from the actual title you see now (and can edit) in the BSI interface with a post or page.
It could even be that your website title is in front of the post title, in that case you would want element [1] instead of [0].
Place the code in an mu-plugin and you’re good to go.
Regards,
Remon.
Thanks!
Correctly, I understood that I need to place the code for version 2.x in a file at wp-admin/includes/plugin.php ?
-
This reply was modified 2 years, 10 months ago by
w1nkeyorg.
Hi @w1nkeyorg
No, please do not change that file. the wp-admin files are WordPress core. You never ever want to touch those (unless searching for information)
You will want to go to the wp-content directory, see if there is a directory called mu-plugins there. (you will see plugins and themes, at least, to verify you are in the correct directory). If there is no directory called mu-plugins, create it.
Then go to that directory and create a file called (for example) bsi-filters.php
Then open it and place the code inside. And obviously, the file will start with a php-open-tag ( <?php )
Then you should be good to go 🙂