Register metabox hooks.

@return void
511839
public function hooks()
    {
        // Register metabox
        // on admin init.
        $this->hook->action(
            'admin_init',
            [$this->metabox, 'register']
        )->dispatch();

        // Save all metabox meta
        // data on post save.
        $this->hook->action('save_post', function ($id) {
            $this->metabox->getModel()->setContext('post');

            $this->metabox->save($id);
        })->dispatch();

        // Save metabox meta data
        // on the comment save.
        $this->hook->action('edit_comment', function ($id) {
            $this->metabox->getModel()->setContext('comment');

            $this->metabox->save($id);
        })->dispatch();
    }
121502
public function addMetaBox()
    {
        foreach ($this->postTypes as $postType) {
            add_meta_box(
                $this->id,
                $this->title,
                $this->callback,
                $postType,
                $this->context,
                $this->priority
            );
        }
    }
290811
public static function register($metaTags)
    {

        if ($metaTags instanceof \mrstroz\wavecms\metatags\models\MetaTags) {

            if ($metaTags->meta_title) {
                Yii::$app->view->title = $metaTags->meta_title;
            }

            if ($metaTags->meta_description) {
                Yii::$app->view->registerMetaTag([
                    'name' => 'description',
                    'content' => $metaTags->meta_description,
                ]);
            }

            if ($metaTags->meta_keywords) {
                Yii::$app->view->registerMetaTag([
                    'name' => 'keywords',
                    'content' => $metaTags->meta_keywords,
                ]);
            }

            Yii::$app->view->registerMetaTag([
                'name' => 'og:url',
                'content' => Yii::$app->request->absoluteUrl,
            ]);

            if ($metaTags->og_type) {
                Yii::$app->view->registerMetaTag([
                    'name' => 'og:type',
                    'content' => $metaTags->og_type,
                ]);
            }

            if ($metaTags->og_title) {
                Yii::$app->view->registerMetaTag([
                    'name' => 'og:title',
                    'content' => $metaTags->og_title,
                ]);
            }

            if ($metaTags->og_description) {
                Yii::$app->view->registerMetaTag([
                    'name' => 'og:description',
                    'content' => $metaTags->og_description,
                ]);
            }

            if ($metaTags->og_image) {
                Yii::$app->view->registerMetaTag([
                    'name' => 'og:image',
                    'content' => Url::base(true) . '/images/' . $metaTags->og_image
                ]);

                list($width, $height) = getimagesize('images/' . $metaTags->og_image);

                if ($width) {
                    Yii::$app->view->registerMetaTag([
                        'name' => 'og:image:width',
                        'content' => $width
                    ]);
                }

                if ($height) {
                    Yii::$app->view->registerMetaTag([
                        'name' => 'og:image:height',
                        'content' => $height
                    ]);
                }
            }
        }

    }
139342
public function registerAdminAction() {
		global $pagenow;

		if ( $pagenow !== 'admin.php' ) {
			return;
		}

		$page_hook = $this->getAdminPageHook();
		$hook_suffix = $this->getAdminHook( $page_hook );

		add_action( "load-{$hook_suffix}", [$this, 'actionAdminLoad'] );
		add_action( $hook_suffix, [$this, 'actionAdmin'] );
	}
227198
public function add_meta_boxes($post_type, $post){
        if( $this->is_valid_post_type($post_type) && $this->has_cap() ){
            if( empty($this->name) || empty($this->label) ){
                $message = sprintf($this->__('<code>%s</code> has invalid name or label.'), get_called_class());
                add_action('admin_notices', function() use ($message) {
                    printf('<div class="error"><p>%s</p></div>', $message);
                });
            }else{
                add_meta_box($this->name, $this->label, [$this, 'render'], $post_type, $this->context, $this->priority);
            }
        }
    }
581145
public function save_meta_all()
	{
		foreach ( $this->meta as $key => $value ) {
			$this->save_meta( $key, $value, false );
		}
	}
1160903
public function register( $post_types = [] ) {
		foreach ( $post_types as $post_type => $callback ) {
			$this->post_types[ $post_type ] = [
				'callback' => $callback,
			];
		}
	}
571056
private function addActions()
    {
        if (isset($this->complement['hooks'])) {
            Hook::getInstance(App::getCurrentID());

            return Hook::addActions($this->complement['hooks']);
        }

        return false;
    }
496780
protected function registerBindings()
    {
        $binding = config('binding')?: [];

        foreach($binding as $contract => $implementation) {
            $this->bind($contract, $implementation);
        }
    }
359960
public function add_meta_boxes() {

		$pod = array(
			'name' => $this->object_type,
			'type' => 'post_type',
		);

		if ( isset( PodsMeta::$post_types[ $pod['name'] ] ) ) {
			return;
		}

		$fields = array(
			array(
				'name'    => 'helper_type',
				'label'   => __( 'Helper Type', 'pods' ),
				'type'    => 'pick',
				'default' => 'display',
				'data'    => array(
					'input'       => 'Input (change form fields)',
					'display'     => 'Display (change field output when using magic tags)',
					'pre_save'    => 'Pre-Save (change form fields before saving)',
					'post_save'   => 'Post-Save',
					'pre_delete'  => 'Pre-Delete',
					'post_delete' => 'Post-Delete',
				),
			),
			array(
				'name'  => 'code',
				'label' => __( 'Code', 'pods' ),
				'type'  => 'code',
			),
		);

		pods_group_add( $pod, __( 'Helper', 'pods' ), $fields, 'normal', 'high' );
	}
1163866
def register_all_hooks():
    
    global _all_hooks_registered
    if not _all_hooks_registered:
        logger.debug("Searching for hooks")
        hooks = list(get_app_submodules('auth_hooks'))
        logger.debug("Got %s hooks" % len(hooks))
        _all_hooks_registered = True
720241
protected function registerCommands()
    {
        $this->application->addCommands([
            new BuildCommand($this->viewFactory, $this->filesystem),
            new PostCommand($this->viewFactory, $this->filesystem)
        ]);
    }
1352521
public function register()
    {
        // Store details
        $fields = $this->getModel()->getFields();
        $title = $this->getModel()->getTitle();

        // Works on hook
        $hook = new UserHook($title, $fields);
        $this->getModel()->setHook($hook);
    }
293065
public function init_hooks() {
		// Required functionality:
		add_filter( 'user_has_cap',                    array( $this, 'filter_user_has_cap' ), 10, 4 );
		add_filter( 'map_meta_cap',                    array( $this, 'filter_map_meta_cap' ), 10, 4 );
		add_filter( 'user_row_actions',                array( $this, 'filter_user_row_actions' ), 10, 2 );
		add_action( 'plugins_loaded',                  array( $this, 'action_plugins_loaded' ) );
		add_action( 'init',                            array( $this, 'action_init' ) );
		add_action( 'all_admin_notices',               array( $this, 'action_admin_notices' ), 1 );
		add_action( 'wp_logout',                       'user_switching_clear_olduser_cookie' );
		add_action( 'wp_login',                        'user_switching_clear_olduser_cookie' );

		// Nice-to-haves:
		add_filter( 'ms_user_row_actions',             array( $this, 'filter_user_row_actions' ), 10, 2 );
		add_filter( 'login_message',                   array( $this, 'filter_login_message' ), 1 );
		add_filter( 'removable_query_args',            array( $this, 'filter_removable_query_args' ) );
		add_action( 'wp_meta',                         array( $this, 'action_wp_meta' ) );
		add_action( 'wp_footer',                       array( $this, 'action_wp_footer' ) );
		add_action( 'personal_options',                array( $this, 'action_personal_options' ) );
		add_action( 'admin_bar_menu',                  array( $this, 'action_admin_bar_menu' ), 11 );
		add_action( 'bp_member_header_actions',        array( $this, 'action_bp_button' ), 11 );
		add_action( 'bp_directory_members_actions',    array( $this, 'action_bp_button' ), 11 );
		add_action( 'bbp_template_after_user_details', array( $this, 'action_bbpress_button' ) );
	}
705917
public function registerMetabox()
    {
        $this->app->bind('metabox', function ($app) {
            $resource = new MetaboxResource(
                $app->bound('league.fractal') ? $app['league.fractal'] : new Manager(),
                new ArraySerializer(),
                new MetaboxTransformer()
            );

            return new Factory($app, $app['action'], $app['filter'], $resource);
        });
    }
799997
public function setupMetaBoxSupport()
    {
        do_action('add_meta_boxes_' . $this->screenHook, null);
        do_action('add_meta_boxes', $this->screenHook, null);

        add_screen_option('layout_columns', array('max' => 2, 'default' => 2));
    }
1065461
protected function registerBindings()
    {
        $this->app->singleton(PageHeaderDirective::class, PageHeaderDirective::class);
        $this->app->singleton(TooltipDirective::class, TooltipDirective::class);
        $this->app->singleton(SearchEngine::class, LocalSearch::class);
    }