• Resolved dorich

    (@dorich)


    On WP 3.7 and Shortcode UI 1.9.8 I have the following symptom.

    Insert php into the appropriate box.
    Set the short code name and the short code type.
    Publish and the short code appears on the list.
    In addition it appears in the post.
    However, it appears that I have an error in my php.
    So I go back and edit the content of the php box.

    Now comes the problem.
    When I click on update, the Shortcode is converted to a post. It is removed from the short code list and appears in the post list.
    I’ve repeated this many times and I cannot stop this happening.
    In addition I removed the plugin and reinstalled but I still get the same result.

    Is this a problem with 3.7 and the plugin?

    https://www.ads-software.com/plugins/shortcodes-ui/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter dorich

    (@dorich)

    Update:

    I tried an experiment with a simple text short code.
    The short code was shown in the short code list and was being inserted into a page where the short code was used.

    Then I edited the contents of the short code and upon clicking update it was converted to a post and removed from the short code list.

    I had a similar problem, found a plug in conflict – in my case, with Post Type Switcher… Shortcodes UI is much more important for my site.

    I did find that I could enable the Post Type Switcher plugin when needed, then disable it before editing any short codes.

    Hi, sorry to hijack this thread but I couldn’t see where else to contact you.

    I am having the exact same problem as you posted here:
    https://www.ads-software.com/support/topic/jquery-not-working-1

    You closed the topic, so I assume you were able to resolve this, but you did not post what the solution was…?

    I have scoured the web high and low and have not been able to make any progress. Please get in touch/reply if you can help! I am sure this will also be of use to others.

    Thanks

    Thread Starter dorich

    (@dorich)

    @conrad90
    Apologies but I don’t recall the solution. My best guess is that it had something to do with registering and enqueueing scripts but I can’t be sure.

    Thanks for the reply – I have figured it out. For the record, it is a multi-step process:

    You need to place your JS in a file of its own (not include in the head), and save this in the JS folder in your WP install.

    Then in functions.php you need to enqueue this script with a url pointing to it. This allows WP to recognize it as kosher/compatible. As far as I can tell, you don’t need to ‘register it’, only enqueue it.

    Then, the head (or body, I assume, but head worked for me), you call this script as you would if you had simply embedded the script in the head in a non-WordPress situation.

    The exact code for each section of this obviously depends on your purposes, but this is the generic process needed to get anything working. Why this isn’t stated so clearly elsewhere on the web is a mystery to me. Hope this helps someone!

    And yes, you do need to replace the $ signs with jQuery – with an uppercase Q – in the head/body section when you call the script. But not in the file in the JS folder that gets enqueued – that one can use regular $ signs.

    Thread Starter dorich

    (@dorich)

    @conrad90
    I’m a neophyte on this subject but I believe that the process of linking to JS files is to register them in the functions file, so they are now universally available by calling their handle. Then, still in the functions file, you can call them on a page by page basis, using the enqueue function. This set up method also provides control over the dependency of the scripts. For example since you want the jQuery library to load before the script in question you can define the dependency in your registration. That way the library will load before the script in question.

    In this manner WP does the work for you and there is no need to add the script to the header.

    Regarding the use of $, I think you will find that you can use
    jQuery(document).ready(function($) {})
    …. and from then on in your script you can use $

    The codex reference is here.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Short code removed after editing code’ is closed to new replies.