Issue with simple-links-default-target filter
-
Mat,
This is related to the following question I asked earlier: https://www.ads-software.com/support/topic/default-to-link-target-_blank?replies=4
I noticed one small issue with using this filter. If you select the target=”_none” option, it actually sets the target to be an empty string (see line 903 of meta-boxes.php). On line 300 of Simple_Link.php, it’s checking to see if $target is empty, and if so it applies the simple-links-default-target filter.
function target_meta_box_output( $post ){ $target = get_post_meta( $post->ID, 'target', true ); if( empty( $target ) ){ $target = apply_filters( 'simple-links-default-target', "" ); } require( SIMPLE_LINKS_DIR . 'admin-views/link-target.php' ); }
However, this means that this filter will apply even if the user has selected target=”_none” because it makes $target an empty string. Since I’ve changed the default to return “_blank”, links that were previously set to target=”_none” will have to be reset every single time the link is edited.
Thanks,
John
- The topic ‘Issue with simple-links-default-target filter’ is closed to new replies.