PHPackages                             newcity/newcity-wp-shortcodes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. newcity/newcity-wp-shortcodes

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

newcity/newcity-wp-shortcodes
=============================

0.5.6(2y ago)01.8k3[4 issues](https://github.com/newcity/newcity-wp-shortcodes/issues)[3 PRs](https://github.com/newcity/newcity-wp-shortcodes/pulls)PHPPHP &gt;=5.4.0

Since Nov 7Pushed 2y ago5 watchersCompare

[ Source](https://github.com/newcity/newcity-wp-shortcodes)[ Packagist](https://packagist.org/packages/newcity/newcity-wp-shortcodes)[ RSS](/packages/newcity-newcity-wp-shortcodes/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (1)Versions (23)Used By (0)

NewCity Shortcodes Wordpress Plugin
===================================

[](#newcity-shortcodes-wordpress-plugin)

This plugin adds shortcodes and an interface for inserting and editing their contents. The editing interface depends on the [Shortcake (Shortcode UI) plugin](https://wordpress.org/plugins/shortcode-ui/)

By default, no shortcodes are added or enabled. To enable individual shortcodes, go to `Settings -> NewCity Shortcodes` and check the codes you wish to enable.

The following shortcodes are included:

- custom\_blockquote
- local\_script
- inline\_media

Setting default enabled plugins for a theme
-------------------------------------------

[](#setting-default-enabled-plugins-for-a-theme)

This plugin sets a Wordpress option called `newcity_shortcodes_options`. It contains a single array called `enabled_shortcodes[]`. By setting this value with PHP, most likely in your theme's `functions.php` file, you can either lock the values down permanently or set up an initial state for the theme.

### Locking down the enabled plugins

[](#locking-down-the-enabled-plugins)

```
// Check for existence of newcity-wp-shortcodes plugin
if ( class_exists('NewCityShortcodes')) {

    // Set value for `newcity_shortcodes_options` only if it does not exist yet
    function set_nc_shortcode_options() {
        $options = array(
            'enabled_shortcodes' => array(
                'custom_blockquote',
                'local_script',
                'inline_media',
            )
        );

        update_option('newcity_shortcodes_options', $options, '', 'yes');
    }

    // Disabled checkboxes in settings window by setting `"permanent"` to `true`
    // in the plugin's options
    function lock_shortcodes_settings() {
        $current_options = get_option('newcity_shortcodes_options', false);
        $locked_options = array_merge($current_options, array('permanent' => array('enabled_plugins')));
        update_option('newcity_shortcodes_options', $locked_options, 'yes');
    }

    // Check if you need to set the enabled shortcodes each time a page loads
    add_action('init', 'set_nc_shortcode_option');
    add_action('init', 'lock_shortcodes_settings');
}
```

### Locking down the local scripts path

[](#locking-down-the-local-scripts-path)

```
function lock_shortcodes_settings() {
    $current_options = get_option('newcity_shortcodes_options', false);
    $locked_options = array_merge($current_options, array('permanent' => array('script_path')));
    update_option('newcity_shortcodes_options', $locked_options, 'yes');
}
```

### Setting initial state for enabled plugins

[](#setting-initial-state-for-enabled-plugins)

```
// Check for existence of newcity-wp-shortcodes plugin
if ( class_exists('NewCityShortcodes')) {

    // Set value for `newcity_shortcodes_options` only if it does not exist yet
    function set_nc_shortcode_options() {
        $options = array(
            'enabled_shortcodes' => array(
                'custom_blockquote',
                'local_script',
                'inline_media',
            )
        );

        if ( ! get_option('newcity_shortcodes_options', false) ) {
            add_option('newcity_shortcodes_options', $options, '', 'yes');
        }
    }

    // Check if you need to set the enabled shortcodes each time a page loads
    add_action('init', 'set_nc_shortcode_option');
}
```

Shortcode Descriptions
----------------------

[](#shortcode-descriptions)

### Custom Blockquote Shortcode

[](#custom-blockquote-shortcode)

Creates a blockquote that supports a citation field and wraps the quote body in a ``:

```

    Quote body goes here
    Citation goes here

```

### Local Script Shortcode

[](#local-script-shortcode)

Allows the enqueuing of javascript files that are stored in the theme folder's `local-scripts` folder. This is a more secure alternative to allowing script code to be pasted directly into the content field.

By default, this shortcode will look for the script named in the `source` attribute in the folder set as the default on the plugin settings page. This folder can be overridden using the `path` attribute, but all script paths must be located inside the current theme's folder.

#### *Enqueuing `{theme-folder}/js/sample.js` when `js` is the default path*

[](#enqueuing-theme-folderjssamplejs-when-js-is-the-default-path)

```
[local_script script="sample" /]

```

#### *Enqueuing `{theme-folder}/custom-path/sample02.js` when `js` is the default path*

[](#enqueuing-theme-foldercustom-pathsample02js-when-js-is-the-default-path)

```
[local_script script="sample02" path="custom-path"]

```

### Inline Media Shortcode

[](#inline-media-shortcode)

A replacement for the default media placement WYSIWYG tools. Inserts an image with optional caption, wrapped in sufficient containers to allow for lots of customization.

```

        { IMAGE CAPTION }

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~466 days

Total

22

Last Release

970d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/93575?v=4)[NewCity](/maintainers/newcity)[@newcity](https://github.com/newcity)

![](https://avatars.githubusercontent.com/u/4974766?v=4)[Jesse Janowiak](/maintainers/wonkeythemonkey)[@wonkeythemonkey](https://github.com/wonkeythemonkey)

---

Top Contributors

[![wonkeythemonkey](https://avatars.githubusercontent.com/u/4974766?v=4)](https://github.com/wonkeythemonkey "wonkeythemonkey (9 commits)")

### Embed Badge

![Health badge](/badges/newcity-newcity-wp-shortcodes/health.svg)

```
[![Health](https://phpackages.com/badges/newcity-newcity-wp-shortcodes/health.svg)](https://phpackages.com/packages/newcity-newcity-wp-shortcodes)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[mautic/core

Mautic Open Source Distribution

9.8k2.6k9](/packages/mautic-core)[mediawiki/maps

Adds various mapping features to MediaWiki

78149.7k3](/packages/mediawiki-maps)[rainlab/blog-plugin

Blog plugin for October CMS

17158.6k](/packages/rainlab-blog-plugin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19246.3k2](/packages/civicrm-civicrm-drupal-8)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3355.8k](/packages/starcitizentools-citizen-skin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
