You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe.
Currently, if shortcodes in distributed post content has website specific attributes (e.g. attachment id, or gravity form id), it distributed without any additional actions, exactly as it was in original post. In this case, the attachment id in the hub website (from where the post is distributed) may not be the same as in website where distributed the post.
Describe the solution you'd like
In order to handle shortcodes distribution added functionality to provide a 'hook' for each shortcode in received post content to make possible to apply all necessary changes in shortcodes.
Designs
In the file distributor/includes/post-specific-content-handler.php function save_post_specific_content(..) (see #372):
// Handle shortcode distribution
// We need just to get all shortcodes in post content regardless their type or hierarchy
$pattern = "/\[(\[?)([^\]]+)(\]?)\]/";
$content = preg_replace_callback(
$pattern,
function ( $matches ) {
$shortcode = $matches[0];
/**
* Filters the the shortcode tags in the post content
*
* @param string $shortcode Whole shortcode tag including wrapped content, if there is any
* @param array $matches the array of matches
*/
$shortcode = apply_filters( 'dt_post_content_shortcode_tags', $shortcode, $matches );
return $shortcode;
},
$content
);
Going to send a PR with the mentioned functionality applied.
Thanks.
Avag
The text was updated successfully, but these errors were encountered:
Is your enhancement related to a problem? Please describe.
Currently, if shortcodes in distributed post content has website specific attributes (e.g. attachment id, or gravity form id), it distributed without any additional actions, exactly as it was in original post. In this case, the attachment id in the hub website (from where the post is distributed) may not be the same as in website where distributed the post.
Describe the solution you'd like
In order to handle shortcodes distribution added functionality to provide a 'hook' for each shortcode in received post content to make possible to apply all necessary changes in shortcodes.
Designs
In the file
distributor/includes/post-specific-content-handler.php
functionsave_post_specific_content(..)
(see #372):Going to send a PR with the mentioned functionality applied.
Thanks.
Avag
The text was updated successfully, but these errors were encountered: