2017 © Pedro Peláez
 

library luna

Command-line interface for Base Camp theme

image

suomato/luna

Command-line interface for Base Camp theme

  • Friday, July 27, 2018
  • by suomato
  • Repository
  • 1 Watchers
  • 3 Stars
  • 285 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 56 % Grown

The README.md

LUNA CLI

Command-line interface for Base Camp theme., (*1)

Commands

Make Custom Post Type

This Command helps you to create a new Custom Post Type very fast., (*2)

php luna make:custom-post-type {name}

The argument is singular form. if noun have irregular plural which do not behave in standard way(singular+s), exception can be defined by plural option e.g., (*3)

php luna make:custom-post-type person --plural=people

The new file is created to /app/config/wp/custom-post-types/{name}.php, (*4)

Make Custom Taxonomy

This Command helps you to create a new Custom Taxonomy very fast., (*5)

php luna make:custom-taxonomy {name}

The argument is singular form. if noun have irregular plural which do not behave in standard way(singular+s), exception can be defined by plural option e.g., (*6)

php luna make:custom-taxonomy country --plural=countries

The new file is created to /app/config/wp/custom-taxonomies/{name}.php, (*7)

Make Route

This Command helps you to create a new route for WordPress API clearer and faster way., (*8)

php luna make:route {name}

The new file is created to /app/config/wp/routes/{name}.php. The created file comes with the well documented boilerplate., (*9)

Make Shortcode

This Command helps you to create a new shortcode with very clean boilerplate., (*10)

php luna make:shortcode {name}

The new file is created to /app/config/wp/shortcodes/{name}.php., (*11)

Example

Run command:, (*12)

php luna make:shortcode LuckyNumber

Then define some data, (*13)

    /**
     * @var string Shortcode name
     */
    protected $shortcode = 'lucky_number';

    /**
     * @var array|string An associative array of attributes
     */
    protected $attributes = [
        'number' => 7,
    ];

    /**
     * Return template of shortcode
     *
     * @param $attr An associative array of attributes
     * @param $content Enclosed content
     *
     * @return mixed
     */
    protected function template($attr, $content)
    {
        return 'This is my lucky number: ' . $attr['number'];
    }

Now shortcode [lucky_number] generates This is my lucky number: 7 and [lucky_number number="13"] generates This is my lucky number: 13, (*14)

It is also possible to use power of Timber. In template function you can return Timber view instead of string like this:, (*15)

// resources/views/shortcodes/lucky-number.twig



This is my lucky number: {{ number }}, (*16)

****************************************************************** // app/config/wp/shortcodes/LuckyNumber.php protected function template($attr, $content) { return \Timber::compile('shortcodes/lucky-number.twig', $attr); }

Make Menu Page

This Command helps you to create a new Menu Page or Submenu Page to wp-admin navigation., (*17)

php luna make:menu-page {name}

This command will create a new MenuPage class in /app/config/wp/menu-pages/{name}.php. The generated file will include the Menu Page properties. Submenu Page could be created by:, (*18)

php luna make:menu-page {name} --submenu

A new SubMenuPage class will be generated in /app/config/wp/submenu-pages/{name}.php, (*19)

The Versions

27/07 2018

dev-master

9999999-dev

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

27/07 2018

v1.3.0

1.3.0.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

11/07 2018

v1.2.2

1.2.2.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

01/07 2018

v1.2.1

1.2.1.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

22/06 2018

v1.1.3

1.1.3.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

19/11 2017

v1.1.2

1.1.2.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

09/11 2017

v1.1.1

1.1.1.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

05/11 2017

v1.1.0

1.1.0.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen

13/09 2017

v1.0.0

1.0.0.0

Command-line interface for Base Camp theme

  Sources   Download

MIT

The Requires

 

by Toni Suomalainen