Forum Replies Created
- AuthorPosts
- rajshekharParticipant
`//functions.php
<?php
add_filter(‘wcfm_menus’,’ws_get_wcfm_menus’, 30, 1);
function ws_get_wcfm_menus($wcfm_menus) {
$wcfm_menus[‘ws-storepep’] = array(
‘label’ => __( ‘StorePep’, ‘whiteshop’),
‘url’ => get_wcfm_storepep_url(),
‘icon’ => ‘shield’
);
// errr_log(‘wcfm functions’);
return $wcfm_menus;
}function get_wcfm_storepep_url() {
global $WCFM;
$wcfm_page = get_wcfm_page();
$get_wcfm_settings_url = wcfm_get_endpoint_url( ‘ws-storepep’, ”, $wcfm_page );
return $get_wcfm_settings_url;
}// // ADD storepep VIEW
add_action( ‘before_wcfm_load_views’, function($end_point) { // wcfm_load_views
//$path = __DIR__ . ‘/wcfm/’;
switch( $end_point ) {
case ‘ws-storepep’:
require_once dirname(__FILE__) . ‘/storepep.php’;
break;
}
});add_filter( ‘wcfm_query_vars’, function( $fields ) {
$wcfm_modified_endpoints = (array) get_option( ‘wcfm_endpoints’ );
$fields[‘ws-storepep’] = ! empty( $wcfm_modified_endpoints[‘ws-storepep’] ) ? $wcfm_modified_endpoints[‘ws-storepep’] : ‘ws-storepep’;
return $fields;
});add_filter( ‘wcfm_endpoints_slug’, function( $fields ) {
$fields[‘ws-storepep’] = ‘ws-storepep’;
return $fields;
});add_filter( ‘wcfm_endpoint_ws-storepep_title’, function( $title ) {
$title = __( ‘WS storepep’, ‘wc-frontend-manager’ );
return $title;
});add_action( ‘init’, function() {
global $WCFM_Query;// Intialize WCFM End points
$WCFM_Query->init_query_vars();
$WCFM_Query->add_endpoints();if( !get_option( ‘wcfm_updated_end_point_ws-storepep’ ) ) {
// Flush rules after endpoint update
flush_rewrite_rules();
update_option( ‘wcfm_updated_end_point_ws-storepep’, 1 );
}
} );rajshekharParticipantfile extensions changed for uploading error
- AuthorPosts