Plugin Directory

Changeset 3227979


Ignore:
Timestamp:
01/24/2025 10:53:07 AM (14 months ago)
Author:
theluckywp
Message:

Use in Oxygen Builder only page/post content.

Location:
luckywp-table-of-contents
Files:
146 added
3 edited

Legend:

Unmodified
Added
Removed
  • luckywp-table-of-contents/trunk/integrations/Oxygen.php

    r2259924 r3227979  
    66use luckywp\tableOfContents\core\Core;
    77
     8use function is_array;
     9use function is_string;
     10
    811class Oxygen extends BaseObject
    912{
    10 
    1113    public function init()
    1214    {
     
    1618        add_action('ct_builder_start', function () {
    1719            global $template_content;
    18             $template_content = Core::$plugin->shortcode->theContent($template_content);
     20            $content = $this->getContent();
     21            if ($content !== null) {
     22                $template_content = str_replace(
     23                    $content,
     24                    Core::$plugin->shortcode->theContent($content),
     25                    $template_content
     26                );
     27            }
    1928            Core::$plugin->onTheContentFalse('');
    2029        }, 9999);
    2130    }
     31
     32    /**
     33     * @return string|null
     34     */
     35    private function getContent()
     36    {
     37        global $post;
     38
     39        $meta = get_post_meta($post->ID, '_ct_builder_json', true);
     40        if (!is_string($meta)) {
     41            return null;
     42        }
     43
     44        $decoded = @json_decode($meta, true);
     45        if (!is_array($decoded)) {
     46            return null;
     47        }
     48
     49        $content = do_oxygen_elements($decoded);
     50        if (!is_string($content)) {
     51            return null;
     52        }
     53
     54        return $content;
     55    }
    2256}
  • luckywp-table-of-contents/trunk/luckywp-table-of-contents.php

    r3184374 r3227979  
    44Plugin URI: https://theluckywp.com/product/table-of-contents/
    55Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
    6 Version: 2.1.9
     6Version: 2.1.10
    77Author: LuckyWP
    88Author URI: https://theluckywp.com/
     
    5050
    5151$config = require(__DIR__ . '/config/plugin.php');
    52 (new \luckywp\tableOfContents\plugin\Plugin($config))->run('2.1.9', __FILE__, 'lwptoc_');
     52(new \luckywp\tableOfContents\plugin\Plugin($config))->run('2.1.10', __FILE__, 'lwptoc_');
    5353
    5454require_once __DIR__ . '/functions.php';
  • luckywp-table-of-contents/trunk/readme.txt

    r3184374 r3227979  
    55Requires at least: 4.7
    66Tested up to: 6.7
    7 Stable tag: 2.1.9
     7Stable tag: 2.1.10
    88Requires PHP: 5.6.20
    99License: GPLv2 or later
     
    161161== Changelog ==
    162162
     163= 2.1.10 — 2025-01-24 =
     164* Use in Oxygen Builder only page/post content.
     165
    163166= 2.1.9 — 2024-11-08 =
    164167* Fix "LuckyWP Plugins" page.
Note: See TracChangeset for help on using the changeset viewer.