예제 #1
0
 function edit()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     $cidvalue = JRequest::getVar('cid_link');
     JRequest::setVar('cid', $cidvalue);
     JRequest::setVar('view', 'modify');
     JRequest::setVar('layout', 'form');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
예제 #2
0
* Author: John Lioneil P. Dionisio
*/
if (!function_exists('add_action')) {
    echo "Hi there!  I'm just a plugin, not much I can do when called directly.";
    exit;
}
require_once 'globals.php';
require_once 'controllers/TestimonialController.php';
include "includes/enqueues.php";
$testimonial = new TestimonialController();
# Initialize
add_action('init', function () {
    global $testimonial;
    $testimonial->register();
});
add_action('add_meta_boxes_' . TestimonialController::$cpt_name_singular, function () {
    global $testimonial;
    $testimonial->metaboxes();
});
add_action('save_post', function ($post_id) {
    global $testimonial;
    $testimonial->save($post_id);
});
# Shortcodes
# Display Employee
add_shortcode(TestimonialController::$cpt_shortcode, function ($atts) {
    ob_start();
    global $testimonial;
    echo $testimonial->display($atts);
    return ob_get_clean();
});