Download the PHP package dark-kitt/wordpress-theme-configuration without Composer

On this page you can find all versions of the php package dark-kitt/wordpress-theme-configuration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wordpress-theme-configuration

WordPress Theme Configuration

Project: Part 1, Part 2, Part 3


Introduction

A base WordPress theme configuration written as MU-Plugin, which includes multiple WordPress hooks to improve your theme. Configure the selected theme in the functions.php file with the listed methods below.

The Autoloader MU-Plugin is required to load this plugin by WordPress. After composer update copy the mu-plugin-autoloader.php file inside of the /mu-plugins directory, to load the WordPress Theme Configuration MU-Plugin automatically.

Note: The REST API uses the JWT Authentication for WP REST API to secure the API endpoints.

General WordPress configurations are placed in the base-configuration.php file. For each type / part of WordPress, you can find a PHP Trait in the /traits directory. E.g.: attachment.php file for Media Library settings, post.php file for the Post settings... etc.

Note: The Gutenberg editor is always disabled! If WP_HOME is different than WP_SITEURL the Gutenberg editor throws multiple errors. If you are interested, take a look at Github WordPress / gutenberg (issue 1761).

Use ACF (Advanced Custom Fields) or install the Classic Editor Plugin, to add content to each post / page.

Methods

Control each method with the passed arguments array or use the default settings. If you are interested in the defaults, want to check out each argument, or set your own custom defaults, take a look inside the trait files in the /trait directory.

Requirements

to maintain content (optional)

Note: If you need an easy way to install this project with all requirements take a look at WordPress Boilerplate project.


Installation

If you have a specific path to your MU-Plugin directory, please add the following lines to your composer.json file.

Afterward, configure the plugin with the functions.php file in the /themes/your-theme directory. Don't forget to insert the JWT Authentication for WP REST API if you want to use the REST_API() method.

Note: For a specific commit of your VCS Repo "require": { "vendor/repo_name": "dev-main#eec8698" } (branch#commit).

common composer cmds

Autoloader for WordPress MU-Plugins

The richardtape/subdir-loader.php Github Gist. Copy the mu-plugin-autoloader.php file inside of the /mu-plugins directory, to load MU-Plugins automatically.


Methods [ Arguments ]

General WordPress configurations are placed in the base-configuration.php file. For each type / part of WordPress, you can find a PHP Trait in the /traits directory. Check out the example.function.php file to get knowledge about the usage and how you can configure your theme inside of the functions.php file in your /themes/your-theme directory.

get_instance()

Executes the singleton instance and return itself.

set_up_theme( $wpdb, $wp_rewrite, $pagenow, array $args = defaults )

Set the defined globals $wpdb, $wp_rewrite and $pagenow and call the main theme set up method. This method will also call the meta_box(); and the company_settings(); methods, which includes the custom SEO meta box, the custom Homepage meta box, the custom Error Page meta box and the Company menu page. The set_up_theme() method gives you the ability to install languages for WordPress and sets further settings for ACF (Advanced Custom Fields). All default arguments are listed below.

post( array $args = defaults )

Use this method to modify the default post section. All default arguments are listed below.

Note: Use ACF (Advanced Custom Fields) or install the Classic Editor Plugin, to add content to each post.

page( array $args = defaults )

Use this method to modify the default page section. All default arguments are listed below.

Note: Use ACF (Advanced Custom Fields) or install the Classic Editor Plugin, to add content to each page.

attachment( array $args = defaults )

Set up options for the Media Library. All default arguments are listed below.

Note: If another theme was previously activated and the new upload directory is different, check the project for the old upload directory and when it is unnecessary delete it manually.

Note: That this method can add also the "Find Duplicates" attachments modal, which goes through the database and compares images to find duplicates.

comments( array $args = defaults )

Remove completely Comments from WordPress.

menu( array $args = defaults )

This method will replace the Menu (nav-menus.php) section from an Appearance submenu page to a top-level page underneath the Pages section. Additionally, the method adds the support for the role editor to edit the Menu section (=> editors can edit menus).

custom_post_type( array $args = defaults )

This is a custom register_post_type method, which includes some additional options. A slug is required to register custom menu locations and to use the custom homepage meta box. All default arguments are listed below.

REST_API( array $args = defaults )

This REST_API() method uses the JWT Authentication for WP REST API to secure the API endpoints. It uses also PHP Mailer to send emails via a REST route. In the examples below, you can see how you can optionally use this instance to configure PHP Mailer for your forms. You can also send the server settings via a POST body request with axios, jQuery, or any other way to send a request.

While you configure your custom REST-API, it is required to create a user with the role rest_api_user. This is important because the user with the role rest_api_user has only access to the REST-API and not to the backend system.

If you are using Postman for testing the API request, to retrieve the token from JWT Authentication for WP REST API, send the username and password as post body (raw/json) data. The \WP_REST_Server::CREATABLE or other methods are described on developer.wordpress.org. Please take a deeper look inside the rest-api.php file to get more information about the handling.

Use the existing instance to push additional methods ($kitt_instance->rest_routes['posts'][] = []) to existing routes or register totally new routes ($kitt_instance->rest_routes['new_route'][] = []) to your REST API configuration.

Note: The axios GET (READABLE) request can not send data via the body.

EXAMPLE: define your custom REST-API

EXAMPLE: configuration for PHP Mailer in the functions.php file

EXAMPLE: for adding a custom REST route in the functions.php file


Note: The Gutenberg editor is always disabled! If WP_HOME is different from WP_SITEURL the Gutenberg editor throws multiple errors. If you are interested, take a look at Github WordPress / gutenberg (issue 1761).

Use ACF (Advanced Custom Fields) or install the Classic Editor Plugin, to add content to each post / page.



License


Includes


All versions of wordpress-theme-configuration with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dark-kitt/wordpress-theme-configuration contains the following files

Loading the files please wait ....