开发者 | iworks |
---|---|
更新时间 | 2024年12月5日 18:27 |
捐献地址: | 去捐款 |
PHP版本: | 8.0 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
Orphans
in Appearance
will appear in your Admin Menu.Upload Plugin
.Orphans
in Appearance
will appear in your Admin Menu.sierotki
folder to the /wp-content/plugins/
directory.Orphans
in Appearance
will appear in your Admin Menu.Plugin works when viewing the content and does not modify your content.
You can do it on Support Threads, but please add your ticket to Github Issues.
Use orphan_replace
filter. Example code:
$value = apply_filters( 'orphan_replace', get_post_meta($post_id, 'meta_key', true ) );
Use orphan_replace
filter. Example code:
$value = apply_filters( 'orphan_replace', 'any string' );
By default to using this plugin you must have manage_options
capability, which usually means site administrator. If you want to allow manage Orphans by "Editors" then you need to use other capabilities, e.g. unfiltered_html
. You can use iworks_orphans_capability
filter:
add_filter('iworks_orphans_capability', 'my_orphans_capability'); function my_orphans_capability($capability) { return 'unfiltered_html'; }
At the beginning of your block just add:
add_filter( 'orphan_skip_replacement', '__return_true' );
and at the end, to again turn on replacements:
remove_filter( 'orphan_skip_replacement', '__return_true' );
Please use iworks_orphan_terms
filter. It is array of default orphans. You can remove, add or even replace whole array. For example, to remove words "oraz", "na" and ""nie", use code bellow:
add_filter( 'iworks_orphan_terms', 'remove_iworks_orphan_terms' ); function remove_iworks_orphan_terms( $terms ) { $default_orphans_to_remove = array( 'oraz', 'na', 'nie', ); foreach( $default_orphans_to_remove as $value ) { if ( $key = array_search( $value, $terms ) ) { unset( $terms[ $key ] ); } } return $terms; }
The default file with definitions is located in the etc/
directory.
You can change it using the filter iworks_orphan_own_terms_file
:
`
add_filter(
'iworks_orphan_own_terms_file',
function( $file ) {
return '<own path to file';
}
);
'
strip_tags()
function has been replaced by the wp_strip_all_tags()
function.wp_remote_get()
function has been replaced by the WP_Filesystem_Direct
class object.terms-cs_CZ.txt
has been renamed to terms-cs.txt
.terms-pl_PL.txt
has been renamed to terms-pl.txt
.orphans_indicator_options
has been added. Props for Krystian Marcisz.orphans_indicator_options_use_cache
has been added to allow cache turn-off.pre
and code
have been added to protected tags.orphan_get_terms
filter has been added. It allows you to get current terms.orphan_replace_acf
filter has been added. It allows you to turn off selected values in ACF fields.orphan_replace_gettext
filter has been added. It allows you to turn off selected values in gettext related functions.gdlr_core_escape_content
filter.vc_shortcode_output
filter.terms.txt
file.add_help_tab()
.class_exists
function.load_plugin_textdomain()
function to allow load i18n even plugin is not active.class_exists
. Props for Piotr.the_title
filter. Props for Zbyszek Zalewskiorphan_allowed_filters
to add ability to change allowed filters.iworks_orphan_own_terms_file
to add ability to change whole terms definition file.etc/terms.txt
.includes/iworks/orphan.php
into includes/iworks/class-iworks-orphan.php
.iworks_orphan_terms
(old one has a typo iworks_orphan_therms
- but old one stays too).vendor
into includes
.orphan_replace
filter to add ability to force replacements on any string.orphan_skip_replacement
filter to force skip replacements. Check FAQ to know how to use it.regular expression is too large
.iworks_orphan
to plugin name `sierotki' to be compatible with i18n WordPress rules.iworks_orphans_capability
, Props for Cezary Buliszak.iworks_orphan_replace