[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog
You are here: Home / oik-clone / oik-clone – Requirements summary / oik-clone – Technical requirements / Support mapping of post IDs within content

Support mapping of post IDs within content

v0.8 of oik-clone is planned to support the mapping of post IDs within content. This means that post IDs used in the source content will be altered to the post IDs of the target content.

Requirements

  • Target to map source post IDs to target post IDs within post content
  • Post content fields supported to include: post_content, post_excerpt, post_title and (possibly) post_content_filtered
  • Mapping should also be performed on postmeta fields which support links and/or shortcode expansion: text, textarea and other specialized fields
  • Mapping to be performed against integers which can be identified as IDs by the context in which they’re used; parameters to shortcodes, within links.
  • Optional mapping of source to target URLs
  • Ability to prevent mapping, for certain edge cases

Example

Suppose the post content contains the [gallery] shortcode using the ids= parameter. which contains a sequence of post IDs of the attached images to display. Each of the source image’s post IDs will need to be mapped to a different target post ID. So “gallery ids=s1,s2,s3″ will become “gallery ids=t1,t2,t3″ Note: I’ve used prefixes to the post IDs to prevent mapping when this requirement gets cloned.

Other examples

There are zillions of shortcodes which use IDs to identify the content to be included or excluded. Here are just a few examples, again using sn for post IDs and http://example.com for the source domain which may also need to be mapped.

[bw_link s1]
[nivo ids=s1,s2,s3]
 

<a href="http://example.com?p=s1">Link to s1 on http://example.com</li>
 
And here are examples where we should not perform mapping since the post IDs are “out of context”

<a href="http://elsewhere.com?p=s1">Link to a different s1 on another domain</li>
I have been thinking about addressing this problem for nearly s2 years now.
[bw_pages posts_per_page=s3]
 
There are also examples where we don’t want mapping

e.g. The source of this page is http://example.com/?p=s1
It has been cloned to http://example.biz/?p=t1
 

Proposed solution

Source
  • Parse for IDs in the content
  • For each ID found determine the target mapping
  • Include this in the ‘mapping’ array
Target
  • Parse for IDs in the content
  • For each ID found lookup the target mapping
  • Verify the target mapping
  • Apply the mapping to the content
The behaviour when the mapping cannot be completed is currently unspecified.

Exclusions

The proposed solution doesn’t take into account all the other instances where unique IDs are used to identify content:

  • IDs associated with taxonomies
  • IDs associated with users
  • IDs associated with WordPress Multisite blogs
  • IDs associated with Comments
  • IDs which reference content in custom tables
  • IDs stored in the options table

The proposed solution doesn’t cater for logic which ensures that slug names are unique

oik-clone – Technical requirements
  • Support cloning of hierarchical content
  • Support complex relationships between content
  • Support pushing of media files with attachments
  • Support pushing of media files using multipart forms

Published: April 2, 2015 | Last updated: December 1, 2020

Information

Component:
  • oik-clone – clone your WordPress content
Letters: S

Recent plugin updates

oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...
oik-types v2.3.0 Update to oik-types v2.3.0 for improved control over sort order on archives ...
UK-tides v3.1.0 UK-tides v3.1.0 now supports several additional ports. It's built with latest wp-scripts and shared libraries and tested with WordPress 6.1. ...
oik v4.8.2 Upgrade to oik v4.8.2 if you installed oik v4.8.1 from wordpress.org and found that the blocks were missing from the editor. ...
sb-chart-block v1.1.0 sb-chart-block v1.1.0 now uses chart.js v3.9.1. Tested with WordPress 6.0.1 and Gutenberg 13.8.2 ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: oikplug@oik-plugins.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.1.1. PHP: 7.4.33. Memory limit: 768M