wordpress/wp-content/themes/basic/themify/themify-builder/classes/class-themify-global-styles.php
/**
	 * Handle Ajax request for save as new global style from a module
	 *
	 * @access static
	 */
Handle Ajax request for save as new global style from a module
@access static
Handle Ajax request for save as new global style from a module @access static
static function save_as_new_ajax() {
		check_ajax_referer( 'tb_load_nonce', 'tb_load_nonce' );
		if ( empty( $_POST['title'] ) || empty( $_POST['type'] ) || empty( $_POST['styles'] ) ) {
			return false;
		}
		$args = array(
			'style-name' => $_POST['title'],
			'style-type' => $_POST['type'],
			'styles' => $_POST['styles']
		);
		$insert_post = self::add_new( $args );
		if ( false === $insert_post ) {
			$response['status'] = 'failed';
			$response['msg'] = __( 'Something went wrong', 'themify' );
		} else {
			$response['status'] = 'success';
			$response['post_data'] = $insert_post;
			$response['msg'] = __( 'Global Style has been saved!', 'themify' );
		}
		wp_send_json( $response );
	}
static function save_as_new_ajax ( ) { check_ajax_referer ( 'tb_load_nonce' , 'tb_load_nonce' ) ; if ( empty ( $ _POST [ 'title' ] ) || empty ( $ _POST [ 'type' ] ) || empty ( $ _POST [ 'styles' ] ) ) { return false ; } $ args = array ( 'style-name' => $ _POST [ 'title' ] , 'style-type' => $ _POST [ 'type' ] , 'styles' => $ _POST [ 'styles' ] ) ; $ insert_post = self :: add_new ( $ args ) ; if ( false === $ insert_post ) { $ response [ 'status' ] = 'failed' ; $ response [ 'msg' ] = __ ( 'Something went wrong' , 'themify' ) ; } else { $ response [ 'status' ] = 'success' ; $ response [ 'post_data' ] = $ insert_post ; $ response [ 'msg' ] = __ ( 'Global Style has been saved!' , 'themify' ) ; } wp_send_json ( $ response ) ; }
Handle Ajax request for save as new global style from a module
 @access static
Handle Ajax request for save as new global style from a module @access static