You appear to be a bot. Output may be restricted
Description
Implement "oik_clone_apply_informal_mapping" to the target post URLsIgnore the target_ids For each of the fields in the post that may contain the source ( master ) root URL replace it with the target ( slave ) URL We need to cater for a number of combinations:
- links
- references in shortcodes e.g.
[bw_link example.com] [bw_link //example.com] [bw_link http://example.com] [bw_link https://example.com] [bw_link example.com/site ]Do we need to care about delimiters?
Usage
$object = oik_clone_apply_informal_relationship_mapping_urls( $post, $target_ids );
Parameters
- $post
- ( object ) required – the target post object
- $target_ids
- ( array ) required – which we ignore for this filter
Returns
object the updated post objectSource
File name: oik-clone/admin/oik-clone-relationships.phpLines:
1 to 10 of 10
function oik_clone_apply_informal_relationship_mapping_urls( $post, $target_ids ) { $master = oik_clone_get_master_schemeless(); $target = oik_clone_get_target_schemeless(); $post->post_content = str_replace( $master, $target, $post->post_content ); $post->post_excerpt = str_replace( $master, $target, $post->post_excerpt ); bw_trace2( $post, "post", false, BW_TRACE_VERBOSE ); return $post ; }View on GitHub