Viewing 4 reply threads
  • Author
    Posts
    • #9094
      cbmarc
      Participant

      Its possible to enable shortcode button on editors on other page builders like “Page Builder by SiteOrigin” or divi editor or enfold editor?

      Attachments:
      You must be logged in to view attached files.
    • #9096
      Steve
      Keymaster

      WordPress has a media_buttons action that we hook into:

      media_buttons

      I suggest you ask the SiteOrigin team if they have the equivalent. And then use something like this:
      https://github.com/piklist/piklist/blob/develop/includes/class-piklist-shortcode.php#L72

    • #9100
      cbmarc
      Participant

      Thanks for the info and the fast reply

      Media button only activated on ‘content’ variable in includes/class-piklist-shortcode.php:

      ———————-
      23 /**
      24 * @var array Registered editors that use shortcodes.
      25 * @access private
      26 */
      27 private static $shortcode_editors = array(‘content’);
      ———————-
      289 /**
      290 * media_buttons
      291 * Adds a shortcode media button to editors.
      292 *
      293 * @param string $editor_id The editor id.
      294 *
      295 * @access public
      296 * @static
      297 * @since 1.0
      298 */
      299 public static function media_buttons($editor_id)
      300 {
      301 if (in_array($editor_id, self::$shortcode_editors))
      302 {
      303 echo ‘<button type=”button” id=”piklist-shortcode-button” class=”button piklist-shortcode-button” title=”‘ . __(‘Add Shortcode’, ‘piklist’) . ‘” data-editor=”‘ . $editor_id . ‘”><span class=”wp-media-buttons-icon”></span> ‘ . __(‘Add Shortcode’, ‘piklist’) . ‘</button>’;
      304 }
      305 }
      ———————-

      But in SiteOrigin need to set ‘widget-sow-editor-c36-text’ and in enfold ‘aviaTBcontent’ and in divi ‘et_pb_content_new’
      Don’t know how to add those variables in the list for activate the button in those editors

    • #9115
      Steve
      Keymaster
      This reply has been marked as private.
    • #9125
      cbmarc
      Participant
      This reply has been marked as private.
Viewing 4 reply threads
  • You must be logged in to reply to this topic.