Rated an average of 0 stars by 0 people

Hello

Script Details:
Added on January 21, 2016 by muaz.
muaz accreditted the script to "."

Description:
Skdbvjsdvsefsef

Tags: ksjd

Code:

function cp_addnew_dropdown_child_categories() {
    global $cp_options;

    if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
        die( json_encode( array( 'success' => false, 'message' => __( 'Sorry, only post method allowed.', APP_TD ) ) ) );
    }

    $parent_cat = isset( $_POST['cat_id'] ) ? (int) $_POST['cat_id'] : 0;
    if ( $parent_cat < 1 ) {
        die( json_encode( array( 'success' => false, 'message' => __( 'Sorry, item does not exist.', APP_TD ) ) ) );
    }

    $terms = (array) get_terms( APP_TAX_CAT, array( 'child_of' => $parent_cat, 'hide_empty' => 0 ) );
    if ( empty( $terms ) ) {
        die( json_encode( array( 'success' => false, 'message' => __( 'Sorry, no results found.', APP_TD ) ) ) );
    }

    $args = array(
        'echo' => 0,
        'child_of' => $parent_cat,
    );

    $result = cp_dropdown_categories_prices( $args );

    // return the result to the ajax post
    die( json_encode( array( 'success' => true, 'html' => $result ) ) );
}<?php
# Snippet from PHP Share: http://www.phpshare.org

?>

Review this PHP Script:

Rating:

Comments:


Login

User:
Pass:

Register

Not a member? Register today and receive the many free benefits of being a member!

Advertisements