I added a shortcode for preg_replace to my SHORTcURL Plugin

Now, with a shortcode for the single most powerful PHP function there is (preg_replace), I dare to imagine that there is nothing that this simple plugin cannot do.

If you know what this amazing function, preg_replace, is capable of then put it to the test.

Here is an example of the syntax for the new new shortcode that calls preg_replace:

[preg_replace replace=”/to be searched/” with=”I replaced”]<li>The content to be searched</li>[/preg_replace]

and this is what you get:

  • The content I replaced

  • My new Plugin for making cURL calls

    I created this plugin that uses a shortcode to call wp_remote_get with parameters you pass to parsed and display a bit of HTML from a page on another site. You can include this shortcode in your page or post.

    Here is an example of the shortcode that will display the Download Stats page for this Plugin on WordPress.org:
    [remote_get url="https://wordpress.org/plugins/shortcurl/stats/" start='&lt;div class="block-content"' stop='!-- block-content--' length="-1"].
    and this is what you get:

    Active Versions

    Downloads Per Day

    Downloads history

    Today 4
    Yesterday 2
    Last Week 24
    All Time 4,335