Reading content of Muffin Builder of one page in another page

I came accross this plugin:
https://srd.wordpress.org/plugins/custom-content-shortcode

Basically it offers implementing content of pages on other pages. The problem: it doesn't take the content of Muffin Builder, but takes only the content of the Wordpress editor.

Why should one use this?
Efficiency.
We'd like to make some pages which's content is then combined on other pages. For example: we make on page 1 some Trailer Boxes. On page 2 some client recommendations.
Then we go to the startpage and just insert the content of page 1 and after that the content of page 2 just by using shortcodes.
This way, if we change something on page 1, it automatically changes on the startpage.

Unfortunately this plugin doesn't take the Muffin Builder content. Or does the Muffin Builder have a certain taxonomy tag we could use to get it's content?

Comments

  • Ok I found a solution by myself. I wrote a function that achieves what I want:

    /* ---------------------------------------------------------------------------
     * Muffin content [muffincontent]                [muffincontent id=$pageid]
     * Shows the muffin builder content of a certain page/post
     * --------------------------------------------------------------------------- */
    if( ! function_exists( 'muffin_content' ) )
    {
        function muffin_content( $attr, $content = null )
        {
            extract(shortcode_atts(array(
                'id'    => '',
            ), $attr));
           
            $output = "";
            if($id > 0)
                $output = mfn_builder_print( $attr['id'] )."\n";

            return $output;
        }
    }
    add_shortcode( 'muffincontent', 'muffin_content' );

    Usage: [muffincontent id="2"] -> inserts muffin content of page / post with id "2"
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.