You have to rewrite your code without closures. It could look like this:
function wpse54191_plugin_init() {
add_post_type('Netherlands', array(
'supports' => array('title', 'editor', 'thumbnail', 'comments')
));
}
add_action('init', 'wpse54191_plugin_init');
/* Add Post Type */
function add_post_type($name, $args = array() ) {
if ( !isset($name) ) return;
$name = strtolower(str_replace(' ', '_', $name));
$args = array_merge(
array(
'label' => 'Members ' . ucwords($name) . '',
'labels' => array('add_new_item' => "Add New $name"),
'singular_name' => $name,
'public' => true,
'supports' => array('title', 'editor', 'comments'),
),
$args
);
register_post_type( $name, $args);
}
Related Posts:
- How do I programmatically add items of content to a custom post type?
- How to get a list of term names of the custom post type im currently on in single.php
- is_singular won’t call my functions?
- Include images from pages in wp search.php results in default wp search
- Ajax filter with custom taxonomies
- List events by month
- Custom post type loops with different page templates
- How can I programmatically save data into custom fields that contain serialized data?
- Adding a span when custom post type is updated
- Row actions not showing? Why?
- Displaying custom post type on front page
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Dynamic Custom Post Type Plugin
- How to filter out post type meta?
- Link users to a custom post type
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Very Slow Page – How to Optimize # of Queries?
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Custom post type permalink returns bad url
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- Get posts from a custom post type by child categories of a parent category
- get the custom post type title/name
- Push metadata in array
- CPT + CMB2: data not displaying for only first post in loop
- Query & Order posts by custom fields
- get_post_meta not working on publishing
- ACF field key/value to show on taxonomy list
- Using custom field content as expression in IF statement [closed]
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- WordPress custom post type split into pages
- Assign External Database Queries to Global Variables and Make Them Accessible
- search suggest – filter post type
- Make a custom_post translatable
- How to update post meta on uploaded image from a custom form?
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Different Category system needed for the Custom Post Type
- Specifying Mouseover Icon for Custom Post
- Displaying custom post types as a gallery
- Pagination hitting 404 page on /page/4
- Get data from PHP to JavaScript to set position of each post on front page
- Get posts from Custom Taxonomy
- Removing full title and breadcrumb header container for a specific post type
- When I choose category from dropdown then everything working fine.But in backend it checked only child not parent [closed]
- Query custom post types & Taxonomies and list them in a table on a page
- Creating a “glossary” of WordPress posts of a specific post type
- Using Pagination for Custom Post Type and keeps returning 404
- Nested Custom Taxonomies | Incorrect posts when querying
- Validate Custom Post Type fields
- meta query not retrieving posts
- How do I get the index for a custom post?
- Commas not displaying in implode
- add custom tags for custom post type in wordpress
- CPT Repeatable Fields + Undefined Index
- foreach loop inside the loop creating duplicates in output
- Function to erase every post from a taxonomy
- Custom Post Type Causes Error: Warning: call_user_func_array()
- Group episodes by seasons
- Is it a connection or relationship between 2 custom post types?
- How to get post count of specific taxonomy that have store name & category
- redirect after submiting post for review
- CPT loop doesn’t seem to account for post date?
- Custom front-end form for adding post – Category problem
- Get only parent post in archive post
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- Alike Shortcode using in Custom Shortcode
- Sort custom post column by generated value?
- Action on Custom Post publish
- Custom post type order by post_title
- Tell wordpress to show a single page instead of an archive page
- Filter Custom Post Type Posts by Taxonomy
- Get meta values from parent post and save in child post
- Change Search display for Custom Post Type
- PHP Notice: Unidentified index
- Add active class to foundation 6 tabs while looping categories
- Duplicate posts in my custom loop
- Include images from pages in wp search.php results in default wp search
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- WP_Query return highest number only
- Meta box not saving
- Featured image in custom post is being disabled
- Why is my custom post type slider only displaying the latest slide?
- Custom Search not working
- using ACF datepicker to filter posts on a page
- WordPress multi-query not returning as expected
- Custom Post-type not returning the right child_of
- WordPress Set A Static Page/Template For All Sub-Pages
- Add HTML before a specific div?
- How to hide home title on pages and posts?
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Custom post type is_singular condtional not working when managing sidebar display
- Issue displaying multiple TinyMCE editors with WPAlchemy