HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/self/cwd/wp-content/plugins/elementskit-lite/modules/dynamic-content/cpt-api.php
<?php 
namespace ElementsKit_Lite;

defined( 'ABSPATH' ) || exit;

class ElementsKit_Cpt_Api extends Core\Handler_Api {

    public function config(){
        $this->prefix = 'dynamic-content';
        $this->param  = "/(?P<type>\w+)/(?P<key>\w+(|[-]\w+))/";
    }

    public function get_content_editor(){
        $content_key = $this->request['key'];
        $content_type = $this->request['type'];
        
        $builder_post_title = 'dynamic-content-' . $content_type . '-' . $content_key;
        $builder_post_id = get_page_by_title($builder_post_title, OBJECT, 'elementskit_content');

        if(is_null($builder_post_id)){
            $defaults = array(
                'post_content' => '',
                'post_title' => $builder_post_title,
                'post_status' => 'publish',
                'post_type' => 'elementskit_content',
            );
            $builder_post_id = wp_insert_post($defaults);

            update_post_meta( $builder_post_id, '_wp_page_template', 'elementor_canvas' );
        }else{
            $builder_post_id = $builder_post_id->ID;
        }

        $url = get_admin_url() . '/post.php?post='.$builder_post_id.'&action=elementor';
        wp_redirect( $url );
        exit;
    }

}
new ElementsKit_Cpt_Api();