PHP code example of itsmejgrant / custom-post-type-helper
1. Go to this page and download the library: Download itsmejgrant/custom-post-type-helper 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/ */
itsmejgrant / custom-post-type-helper example snippets
function my_custom_function() {
// Includes optional menu icon argument
$books = new CustomPostType('Books', 'dashicons-book');
}
add_action('init', 'my_custom_function');
function my_custom_function() {
$people = new CustomPostType('People');
$people->set_labels([
'singular_name' => 'Person'
]);
}
add_action('init', 'my_custom_function');
function my_custom_function() {
$sandwiches = new CustomPostType('Sandwich');
$sandwiches->set_args([
'menu_icon' => 'dashicon_sandwich'
]);
}
add_action('init', 'my_custom_function');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.