Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Feature Request
    lnki5538
    Participant

    Hello Aakash,

    I’d like to suggest two specific hooks that could greatly enhance the plugin’s utility in our scenario:

    1. A hook immediately after pressing “Locate this shortcode”: By having a hook right after the shortcode is located, it would allow for more dynamic interaction with the shortcode, especially in cases where shortcodes are defined on a different site within the network.

    2. A hook when pressing the blue [/] “Insert shortcode to editor” button: This is crucial for our use case. If this hook is available, it would enable us to programmatically execute switch_to_blog(1); and subsequently restore_current_blog();. This functionality would allow us to seamlessly integrate shortcodes from the main site (site with ID 1) into our other sites within the multisite network, without losing the integration with WP Bakery page builder or other features.

    Thank you for considering these suggestions.

    in reply to: Migration from 4.x to 5.0.6
    lnki5538
    Participant

    Hello, I worked around in this way:

    • exported in JSON in 4.x,
    • cleaned up the 4.x shortcode list,
    • upgraded to 5.x
    • clean up the 5.x shortcode list (deleting from trash),
    • converted the export in CSV using https://www.convertcsv.com/json-to-csv.htm,
    • removed the 5.x and then installed it again,
    • imported the CSV via WP All Import plugin as explained on your site.

    Now I have another question, in function php I have this custom code:

    add_filter( 'do_shortcode_tag','pre_query_mssql_execute',10,3);
    
    function pre_query_mssql_execute($output, $tag, $attr)
    {
        if (isset($attr['name']) && strpos($attr['name'], 'query_mssql') !== false)    {
            switch_to_blog(1);
            $a = get_option( 'shortcoder_data' );
            $shortcode_content = $a[$attr['name']]["content"];			
            $output = query_mssql_execute($shortcode_content,$attr);
            restore_current_blog();
        }
    ........
    

    Now it is clear that get_option is the old way to retrieve the shortcode content.
    How I can retrieve $shortcode_content by post title and the custom type?
    Is filtering at do_shortcode_tag still valid?

    Thank you
    Andrea

Viewing 2 posts - 1 through 2 (of 2 total)

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms