Forum Replies Created
-
Author
-
maxhiltonParticipant
HI,
I did not receive any reply yet. Do I need to submit the ticket again ? Thannks
maxhiltonParticipantHi,
Can I know where can I paste this code ? I’m not good in coding part so please kindly guide me on this. Thanks.
——————————————————————————————————-
<?php
/**
* @package Membership_Features
* @version 0.1
*/
/*
Plugin Name: Membership Features
Description: Implements a custom post type, “Feature”, which replaces the default features used in the membership pricing table of the Kleo Theme. To use, first create new features as required, then enable or disable them in the Theme Options -> Memberships.
Author: Potion
Version: 0.1
*//**
* Register custom post type: membership_feature
*/
add_action( ‘init’, ‘create_feature_post_type’ );
function create_feature_post_type() {
register_post_type( ‘membership_feature’,
array(
‘labels’ => array(
‘name’ => _x( ‘Features’ ),
‘singular_name’ => _x( ‘Feature’ ),
‘add_new’ => _x( ‘Add New’ ),
‘add_new_item’ => __( ‘Add New Feature’ ),
‘edit_item’ => __( ‘Edit Feature’ ),
‘new_item’ => __( ‘New Feature’ ),
‘all_items’ => __( ‘All Features’ ),
‘view_item’ => __( ‘View Feature’ ),
‘search_items’ => __( ‘Search Features’ ),
‘not_found’ => __( ‘No features found’ ),
‘not_found_in_trash’ => __( ‘No features found in Trash’ ),
‘parent_item_colon’ => ”,
‘menu_name’ => __( ‘Features’ ),
),
‘public’ => true,
‘publicly_queryable’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘feature’ ),
‘capability_type’ => ‘post’,
‘has_archive’ => true,
‘hierarchical’ => false,
‘menu_position’ => 120,
‘supports’ => array( ‘title’)
)
);
}/**
* Use membership_feature posts to populate features for Kleo Theme Membership Level Pricing Table
*/
add_filter(‘kleo_pmpro_level_restrictions’, ‘kleo_my_levels_checkmarks’);
function kleo_my_levels_checkmarks($settings) {$args = array(
‘post_type’ => ‘membership_feature’,
‘posts_per_page’ => -1);query_posts( $args );
if (have_posts) {
$settings = array ();
while (have_posts()) : the_post();
array_push( $settings, array(
‘title’ => __(‘Restrict ‘ . get_the_title(), ‘kleo_framework’),
‘front’ => __( get_the_title(), ‘kleo_framework’),
‘name’ => basename(get_permalink($post->ID))
)
);endwhile;
}wp_reset_query();
return $settings;
}
——————————————————————————————————– -
AuthorPosts