PHP code example of proklung / wp-custom-page-editor-bundle

1. Go to this page and download the library: Download proklung/wp-custom-page-editor-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

proklung / wp-custom-page-editor-bundle example snippets


class ExampleEntity extends DataManager
{
    /**
     * @inheritDoc
     */
    public function getTableName() : string
    {
        return 'wp_example_custom_table';
    }

    /**
     * @inheritDoc
     */
    public function getEntityName(): string
    {
        return 'Example';
    }

    /**
     * @inheritDoc
     */
    public function getMap(): array
    {
        return [
            [
                'name' => 'new_column',
                'description' => 'Новый столбец',
                'type' => 'varchar',
                'length' => 50,
                'nulled' => false,
                'sortable' => true,
                'default' => '',
                'red' => false,
                'validators' => [
                    new Assert\Length([
                        'min' => 2,
                        'max' => 150,
                        'minMessage' => 'Description must be at least {{ limit }} characters long',
                        'maxMessage' => 'Description cannot be longer than {{ limit }} characters',
                    ])
                ]
            ],
            [
                'name' => 'picture',
                'description' => 'Картинка',
                'type' => 'int',
                'view_type' => 'text',
                'sortable' => true,
                'default' => 0,
                '