Action on Custom Post publish

Issue is resolved Updated Code <?php /* Plugin Name: Send Notification CPT Description: Declares a plugin that will create a custom post type to send notifications. Version: 1.0 */ if( ! defined(‘ABSPATH’)) { exit; } // Register Custom Post Type Send Notifiction function create_sendnotifiction_cpt() { $labels = array( ‘name’ => _x( ‘Send Notifiction’, ‘Post Type … Read more

How do i post data to url with fields?

You have to build the array as the json array needs to be $args = array( ‘headers’ => array( ‘Content-Type’ => ‘application/json’, ‘Authorization’ => ‘Basic ‘.$apiKey ) ); $bdy = array( ‘fields’=> array( ‘project’ => array( ‘key’ =>’LD’ ), ‘summary’=> ‘CODING WORKS’, ‘description’ => ‘Creating of an issue using project keys and issue type names … Read more

Access checks with custom REST endpoints and backbone

The issue was I overrode the Backbone.sync method only in Backbone.Model. When Backbone fetches the initial data (GET) it is using the sync method in Backbone.collections. So I need to override the sync in Backbone.Collections: app.Collection = Backbone.Collection.extend({ sync: function( method, model, options ){ return Backbone.sync(method, this, jQuery.extend( options, { beforeSend: function (xhr) { xhr.setRequestHeader( … Read more