Register post type hook callback.
165209
public function register()
    {
        $this->instance = register_post_type($this->slug, $this->getArguments());
        $this->registerStatus();
    }
958263
private function register() {

		$this->options['labels'] = $this->label;
		if (!isset($this->options['rewrite'])) {
			$this->options['rewrite'] = array('slug' => $this->singular);
		}

		$_self = &$this;

		add_action('init', function () use (&$_self) {
			register_post_type($_self->singular, $_self->options);
		});

	}
105252
def hook(self, *hook_names):
        """"""
        def wrapper(decorated):
            for hook_name in hook_names:
                self.register(hook_name, decorated)
            else:
                self.register(decorated.__name__, decorated)
                if '_' in decorated.__name__:
                    self.register(
                        decorated.__name__.replace('_', '-'), decorated)
            return decorated
        return wrapper
318992
def register_hooks(func, hooks, obj):
    
    for name, args, kwargs in hooks:
        hook = getattr(obj, name)
        force_call = kwargs.pop("_force_call", False)
        if force_call or len(args) > 0 or len(kwargs) > 0:
            hook = hook(*args, **kwargs)
        hook(func)
564188
public function hookCallback()
    {
        $name = $this->getModel()->getName();

        // Check Ajax referer
        check_ajax_referer($name, 'nonce');

        // Call custom callback function
        $data = $this->callback();

        // Build JSON data
        wp_send_json_success($data);

        // Stops everything
        wp_die();
    }
180236
def trigger_staged_hook(self, name, *args, **kwargs):
        
        self.trigger_hook("pre_" + name, *args, **kwargs)
        self.trigger_hook("on_" + name, *args, **kwargs)
        self.trigger_hook("post_" + name, *args, **kwargs)
316540
function addHook($type, $func, $prepend = false, $subtype = false)
    {
        if ($subtype)
        {
            if ($prepend)
            {
                array_unshift($this->hooks[$type][$subtype], $func);
            }
            else
            {
                $this->hooks[$type][$subtype][] = $func;
            }
        }
        else
        {
            if ($prepend)
            {
                array_unshift($this->hooks[$type], $func);
            }
            else
            {
                $this->hooks[$type][] = $func;
            }
        }
    }
476644
def register_function_hooks(self, func):
        """"""
        for hook_kind, hooks in func.xworkflows_hook.items():
            for field_name, hook in hooks:
                if field_name and field_name != self.state_field:
                    continue
                for transition in self.workflow.transitions:
                    if hook.applies_to(transition):
                        implem = self.implementations[transition.name]
                        implem.add_hook(hook)
335142
public function registerPostType()
    {
        // create options for the PostType
        $options = $this->createOptions();

        // check that the post type doesn't already exist
        if (!post_type_exists($this->name)) {
            // register the post type
            register_post_type($this->name, $options);
        }
    }
831112
public function triggerHook()
    {
        $hookUrl = $this->getLink('#hook');
        $options = [];

        // The API needs us to send an empty JSON object.
        $options['json'] = new \stdClass();

        // Switch off authentication for this request (none is required).
        $options['auth'] = null;

        $this->sendRequest($hookUrl, 'post', $options);
    }
877661
def __add_callback(self, type_, func, serialised_if_crud=True):
        """"""
        Validation.callable_check(func)
        with self.__callbacks:
            self.__callbacks[type_].append((func, serialised_if_crud))
251151
protected function registerStatus()
    {
        if (empty($this->status)) {
            return;
        }

        foreach ($this->status as $key => $args) {
            register_post_status($key, $args);
        }

        Metabox::make('themosis_publish', $this->slug)
            ->setTitle(__('Publish'))
            ->setContext('side')
            ->setPriority('core')
            ->setCallback(function ($args) {
                echo view('_themosisPublishMetabox', [
                    'statuses' => $this->status,
                    '__post' => $args['post']
                ]);
            })
            ->set();
    }
805406
private static function register_extensions( $post_type, $args ) {
		if ( isset( $args['name_singular'] ) ) {
			( new Post_Type_Labels( $post_type, $args['name_singular'], $args['name_plural'] ) )->init();
		}

		if ( isset( $args['query'] ) ) {
			( new Post_Type_Query( $post_type, $args['query'] ) )->init();
		}

		if ( isset( $args['admin_columns'] ) ) {
			( new Post_Type_Columns( $post_type, $args['admin_columns'] ) )->init();
		}

		if ( isset( $args['page_for_archive'] ) ) {
			( new Post_Type_Page(
				$post_type,
				$args['page_for_archive']['post_id'],
				$args['page_for_archive']
			) )->init();
		}
	}
1128426
protected function _registerPostTypesFromConfigure()
    {
        $configure = Configure::read('CA.Models');

        foreach ($configure as $name => $model) {
            $this->register($model);
        }
    }
735779
def register_callback(self, callback, remove=False):
        """"""

        # (Un)Register the callback.
        if remove and callback in self.callbacks:
            self.callbacks.remove(callback)
        elif not remove and callback not in self.callbacks:
            self.callbacks.append(callback)
418706
def register(self, name: str):
        ''''''
        if name in self._callbacks:
            raise ValueError('Hook already registered')

        self._callbacks[name] = None

        if self._event_dispatcher is not None:
            self._event_dispatcher.register(name)
841105
def post(self, object_type, object_id):
        """"""
        if object_id == 0:
            return Response(status=404)

        tagged_objects = []
        for name in request.get_json(force=True):
            if ':' in name:
                type_name = name.split(':', 1)[0]
                type_ = TagTypes[type_name]
            else:
                type_ = TagTypes.custom

            tag = db.session.query(Tag).filter_by(name=name, type=type_).first()
            if not tag:
                tag = Tag(name=name, type=type_)

            tagged_objects.append(
                TaggedObject(
                    object_id=object_id,
                    object_type=object_type,
                    tag=tag,
                ),
            )

        db.session.add_all(tagged_objects)
        db.session.commit()

        return Response(status=201)