Shortcoder — Create Shortcodes for Anything

説明

Shortcoder プラグインは、HTML、JavaScript、CSS およびその他のコードスニペットのカスタムショートコードを作成できます。作成したショートコードは投稿、固定ページで使用でき、スニペットとして置き換えられます。

✍ ショートコードを簡単に作成

  1. 作成するショートコードに名前をつけます
  2. 作成したいショートコードの HTML / JavaScript / CSS コードをペーストします。
  3. 保存します。
  4. これで、作成したショートコードを[sc name="my_shortcode"]として投稿や個別ページに挿入できます。
  5. 出来上がり ! 投稿で HTML / Javascript / CSS スニペットが使えるようになりました。

✨ 特徴

  • カスタムショートコード を簡単に作成し、ショートコードがサポートされているところならどこでも使用することができます。
  • HTMLJavascriptCSS のショートコードが作成できます。
  • ショートコードに カスタム変数 が挿入できます。
  • ショートコードに WordPress 変数 が挿入できます。
  • 複数のエディターに対応: コード、ビジュアル、テキストモード。
  • 作成したショートコードが不要な場合、グローバルで無効化できます。
  • ショートコードをモバイル端末やデスクトップで無効化できます。
  • 投稿エディターにショートコードを選択、挿入するボタンが追加されます。
  • Gutenberg サポート。

🎲 使用例

  1. Shortcoder 管理ページで “adsenseAd” という名前のショートコードを作成します。
  2. 表示されたボックスに AdSense コードを貼り付けて保存します。
  3. 投稿や個別ページで [scname = "adsenseAd"] を使用します。
  4. ジャジャーン !!! これでショートコードが広告コードに置き換えられ、投稿に表示されます。
  5. これで、広告コードを1か所で編集することができ、ショートコードが使用されているすべての場所でコードが更新されます。

同じように、頻繁に使用されるスニペットもショートコードを作成できます。

スニペット内に カスタム変数 ( %%id%% など ) を追加することもできます。使用する場合は、[sc name="youtube" id="GrlRADfvjII"] のように値を変更します。

🧱 Using in block editor

Though shortcodes can be used in any place manually, Shortcoder provides below options to select and insert the shortcodes created easily when working with the block editor.

  • Shortcoder block
  • Toolbar button to select and insert shortcodes inline (under “more”)

💎 Upgrade to PRO

Shortcoder also provides a PRO version which has additional features to further enhance the experience. Below features are offered in the PRO version.

  • Custom editor – Edit Shortcode content using block editor or page builder plugins like Elementor and WPBakery.
  • Revisions – Revisions support for Shortcode content.
  • Locate shortcode – Search posts and pages where a shortcode is used.
  • Extra code – Include extra code to the footer when a shortcode is used in a page.

Get started with Shortcoder – PRO

リンク

スクリーンショット

  • Shortcoder 管理ページ。
  • ショートコードの編集。
  • ショートコードを選択して挿入するためのポップアップ。
  • 投稿に挿入されたショートコード。
  • Gutenberg エディターの Shortcoder ブロック。
  • Shortcoder を投稿で確認。
  • Insert shortcode inline from block editor toolbar.

ブロック

このプラグインは1個のブロックを提供します。

  • Shortcoder

インストール

  1. zipファイルを解凍し、Shortcoderr フォルダーを /wp-content/plugins/ ディレクトリにアップロードします。
  2. WordPress メニューの プラグイン から有効化します。
  3. ナビゲーションメニューの “Shortcoder” リンクから管理ページを開きます。

FAQ

すべての FAQ を確認したい場合は、プラグインのドキュメントページにアクセスしてください。

ショートコード名に使える文字列は何ですか ?

使用できる文字列は、アルファベット、数字、ハイフンとアンダースコアです。

ショートコードがページビルダーで機能しません !

ショートコードが使用されているブロック / 場所 / エリアがショートコードを実行可能かどうかをページビルダープラグインで確認してください。 実行可能な場合、ショートコードは通常の WordPress ショートコードと同じように機能するはずです。

ショートコードが機能しません !

ショートコードの内容が期待通りに出力されない場合は、以下をご確認ください。

  • ショートコードの内容が出力されているかを確認してください。 ショートコードの内容が出力されていない場合は、ショートコードの設定をチェックして、ショートコードが出力される場所とタイミングを制限する設定が有効になっているかどうかを確認してください。 また、ショートコード名が正しく、ショートコードに重複する 名前 属性がないかどうかを確認します。
  • ショートコードが出力されても期待通りでない場合は、独立した環境でショートコードを試して、ショートコードが期待通りに正しく機能しているかどうかを確認してください。 テーマなどの外部要因である場合もあれば、使用されているショートコードと競合するプラグインがある場合もあります。
  • ショートコードAPIには既知の制限事項として、閉じられていないショートコードと閉じられたショートコードの組み合わせがある場合があります。 詳細については、このドキュメントを参照してください。

ショートコードに PHP を挿入できますか ?

いいえ、現在、このプラグインがサポートしているショートコードは HTML、Javascript、CSS のみです。

Can I use block editor or page builders like Elementor, WPBakery to create shortcode?

Yes, this feature is available in the PRO version. You can upgrade to the PRO version to design using custom editor and create shortcode for that.

評価

2023年10月2日
Works well, but not compatible with WPML. So, it is good for local businesses only. Also, it did not work in the Cloud Templates (TagDiv/Newspaper), so I could not use it in the header or footer. I don't know if there is a solution to this, I did not investigate this issue further as WPML compatibility is critical.
2023年5月5日 3 replies
The plugin is great, unfortunately ot does not interact well with WPML
2023年3月3日 1 reply
Thank you for this plugin. It is lightweight, intuitive, and effective. I have used several similar plugins in the past in an attempt to give my clients more content control. However, those plugins either have been abandoned or do not work in some contexts (e.g., in archive pages of custom post types). Shortcoder will be my new go-to.
2023年2月1日 1 reply
I've searched high and low for a shortcode plugin to meet my needs. For some reason this plugin never showed up in the first few pages of my plugin search from the Wordpress add plugin page. Instead my searches were inundated with plugins that provided a selection of preset shortcodes for various functions. I was to the point of mapping out writing my own plugin with the features I'd like, sighing at the prospect of yet another project I don't have time for, when I stumbled upon Shortcoder. All I can say is it's exactly what I needed! Adding and managing custom shortcodes was never easier. I even had several instances of "Wouldn't it be cool if this plugin did... oh wait ... IT DOES!" I rarely find software that motivates me to write a 5-star review, well, Shortcoder is one. Kudos to the software engineer(s) and excellent work! By the way, contrary to other reviews, it absolutely works perfectly in Woocommerce product pages.
215件のレビューをすべて表示

貢献者と開発者

Shortcoder — Create Shortcodes for Anything はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Shortcoder — Create Shortcodes for Anything” は12ロケールに翻訳されています。 翻訳者のみなさん、翻訳へのご協力ありがとうございます。

“Shortcoder — Create Shortcodes for Anything” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

6.3.2

  • Fix: Verify permissions while closing Shortcoder changelog.

6.3.1

  • Fix: Admin ajax vulnerability with nonce.

6.3

  • New: Set default value for the custom field parameters.
  • New: Custom parameter default value is shown in the insert shortcode popup.
  • Fix: Restrict access to admin-ajax calls.
  • Fix: Some admin texts were missing translation.
  • Fix: Removed the note in the insert popup for fully closed shortcode.
  • Fix: Debug comment line now has the name of the shortcode.

6.2

  • New: Option to show shortcode content in “All shortcodes” page.
  • Fix: Some texts were not translated.
  • Fix: Error in WP Bakery page builder while picking images.

6.1

  • New: Enhancements to shortcode edit screen meta boxes.
  • Fix: HTML is escaped in the editor sometimes.
  • Fix: Support for WordPress 6.1

6.0

  • New: PRO version is introduced.
  • New: Prevent same shortcode nested loop.
  • New: New actions and filters introduced.
  • Fix: Post excerpt shortcode parameter now prints full post excerpt.
  • Fix: Enhancements to input and output data sanitization.

5.8

  • New: Option to set description for the shortcode.
  • New: New actions and filters introduced.
  • Fix: Minor admin UI enhancements.

5.7

  • New: Reordered shortcode column in the “All shortcodes” page.
  • New: Option to copy shortcode directly from “All shortcodes” page.
  • New: Filter sc_mod_content to modify shortcode content before execution.
  • Fix: Shortcode won’t save if the email field in the feedback form has invalid value.
  • Fix: Custom parameter with hyphen was not highlighted in code editor.
  • Fix: Minor admin UI enhancements.

5.6

  • New: Shortcodes available to copy/insert are now closed by default.
  • Fix: Custom parameter value 0 is not displayed.
  • Fix: Support for WordPress 5.8

5.5

  • New: General settings page to configure default editor and shortcode content.
  • New: Block to insert shortcode rewritten from scratch.
  • New: Toolbar button to insert shortcodes inline.
  • New: Shortcodes are now closed by default when inserted from editor.
  • Fix: Custom fields parsing issue when they are placed next to each other.
  • Fix: Enclosed content in block input now retains multi-line.
  • Fix: Minor refinements to UI.

5.4

  • New: Code editor is now loaded locally and not from cloudflare.
  • New: Code editor now shows hints and highlights any syntax error.
  • New: Hyphens can now be used in shortcode custom parameters.
  • Fix: Handle scenario where shortcode attribute is received as a string sometimes.
  • Fix: Notice where wp_localize_script was called incorrectly.
  • Fix: Handle scenario where HTML is passed as shortcode parameter.
  • New: WordPress requirement changed from 4.4 to 4.9

5.3.4

  • New: Tested with WordPress 5.6
  • Fix: Handle warning with trim while fetching page metadata at some pages.

5.3.3

  • New: Support for post slug as the new shortcode parameter under WordPress information.
  • New: Codemirror has been updated to latest version.
  • Fix: Handle code editor loading issue when there is any collision.
  • Fix: Handle input fields which have empty id attribute.
  • Fix: Handle issue of $post object being undefined at some cases.
  • Fix: Renamed usages of __class__ to __CLASS__

5.3.2

  • New: In code editor, shortcodes will be highlighted and code editor font size is slightly bigger.

5.3.1

  • New: Code editor is now made the default editor.
  • Fix: Minor changes to admin UI.

5.3

  • New: Added support for underscores in custom parameters.
  • New: Getting ready for internationalization of the plugin.
  • Fix: Insert shortcode popup shows duplicate available parameters in case of same parameter with different case.

5.2.1

  • Fix: Custom parameters being not replaced in some scenarios.
  • Fix: Minor enhancement to insert custom parameter form.

5.2

  • New: Default values can now be provided to custom parameters.
  • Fix: Script tags, custom field placeholder and backslash being stripped after saving the shortcode sometimes.
  • Fix: Rel attribute being modified for links.
  • New: Added “Manage shortcodes” link to plugin list page for easy access after activation.

5.1

  • New: Import/Export link added to the shortcoder list page.
  • Fix: empty() was throwing error at some places for users using PHP 5.5 below as function return value was passed to it.
  • Fix: Shortcoder QTTags button was loading in frontends.
  • Fix: “Insert shortcode” popup was hidden behind in theme customizer page.
  • Fix: array_key_exists array but bool given warning.
  • Fix: Hide comments metabox in shortcode edit page as it was shown in certain conditions.

5.0.4

  • Fix: script and style tags stripped after 4.x upgrade. New migration will run in this version and shortcode content will now be fixed.

5.0.3

  • Fix: Shortcode content is not escaped when code editor is used. This is requirement because post_content behaves strangely when user has rich editing enabled.

5.0.2

  • Fix: Shortcodes inside shortcode content not getting executed.
  • Fix: Disable Gutenberg block for older not supported WordPress versions.

5.0.1

  • Fix: Code editor escaping HTML characters.
  • Fix: get_current_screen() undefined.
  • Fix: Code editor breaks if there is any other plugin which loads codemirror.
  • Fix: tools.php is not found.

5.0

  • New: Brand new version. Plugin rewritten from scratch.
  • New: Shortcoder block for the block editor.

4.4

  • New: Insert shortcode automatically adds “closing tag” if the shortcode has enclosed content parameter.
  • Fix: Codemirror has been updated to latest version.

4.3

  • New: Edit shortcode name after creating.
  • New: Post modified date parameter added.
  • Fix: Date parameters now display in site language.

4.2

  • Fix: Some plugins fail to fire onload JS event since it was overwritten by shortcoder.
  • Fix: Javascript in insert shortcode popup not working in IE 11.
  • Fix: Missing parenthesis while calling is_year.
  • Fix: Widgets page not loading insert shortcode popup.
  • Fix: Removed settings emoji icon from plugin actions list.
  • Fix: Load latest version 5.42.0 of codemirror.
  • Fix: Updated minimum required WordPress version.

4.1.9

  • Fix: Minor UI refinements for better experience.
  • Fix: Import error where some exported JSON files have 0 as EOF.

4.1.8

  • New: Insert custom fields in shortcode content.
  • Fix: Removed comments in shortcode output

4.1.7

  • New: Categorize, search and filter shortcodes using “tags”.
  • New: Last used shortcode editor will be saved along with shortcode.
  • New: Enclosed shortcode content can now be used as shortcode parameter.
  • New: Active line highlight has been enabled for code editor.
  • Fix: Codemirror has been updated to latest version.
  • Fix: Minor admin interface enhancements.

4.1.6

  • New: Date variables can noe be added into shortcode content.
  • Fix: Error “trying to get property of non-object” is handled.

4.1.5

  • New: Bloginfo variables can now be added into shortcode content.

4.1.4

  • New: Codemirror powered syntax highlighted shortcode content code editor (beta).

4.1.3

  • Fix: Shortcode names with not-allowed characters cannot be edited/deleted.
  • New: Shortcode imports made can now be fresh or overwritten.
  • New: Only users with manage_options capability will see “edit shortcode” option in insert window.
  • Fix: Import failure with UTF-8 characters.
  • Fix: Case sensitive search in admin pages.
  • Fix: Minor admin interface changes.

4.1.2

  • New: Search box for shortcodes in admin page.

4.1.1

  • Fix: HTTP 500 error because of syntax error in import module.

4.1

  • New: Import/export feature for shortcodes.
  • Fix: Visual editor is now disabled by default.
  • Fix: Added instructions in admin page.

4.0.3

  • New: Added feature to sort created shortcodes list.
  • Fix: HTML errors in admin page

4.0.2

  • Fix: Sometimes get_current_screen() was called early in some setups.

4.0.1

  • Fix: Servers with PHP version < 5.5 were facing HTTP 500 error because of misuse of PHP language construct in code.

4.0

  • New: Plugin rewritten from scratch.
  • New: Brand new administration page
  • New: Shortcode visibility settings, show/hide in desktop/mobile devices
  • New: Insert WordPress information into shortcode content.
  • Fix: Insert shortcode window is not loading.
  • Fix: Unable to delete the shortcodes

(Older change logs are removed from this list)