HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/cornerstone/includes/classes/Services/DevToolkit.php
<?php

namespace Themeco\Cornerstone\Services;

class DevToolkit implements Service {

  public function save( $params ) { // See Controllers/Save.php
    if ( ! current_user_can( 'manage_options' ) ) {
      throw new \Exception( 'Unauthorized' );
    }

    if ( ! isset( $params['name']) || ! $params['name'] ) {
      throw new \Exception( 'Attempting to save dev toolkit data without specifying a name.' );
    }

    if ( ! isset( $params['data']) || ! $params['data'] ) {
      throw new \Exception( 'Attempting to save dev toolkit data without specifying data.' );
    }


    do_action( 'cs_dev_toolkit_user_save', $params['name'], $params['data'] );

    return [ 'success' => true ];

  }

  public function getAppData() {
    return apply_filters('cs_dev_toolkit', [] );
  }

  public function registerPostTypes() {
    register_post_type( 'cs_template', array(
      'public'              => false,
      'exclude_from_search' => false,
      'capability_type'     => 'page',
      'supports'            => false
    ) );

    // Classic Cornerstone templates
    register_post_type( 'cs_user_templates', array(
			'public'          => false,
			'capability_type' => 'page',
			'supports'        => false
    ));
  }

}