<?php /** * Plugin metabox functions */ /** * Globalize Plugin options */ global $wpbitly_options; $wpbitly_options = wpbitly_get_options(); /** * Hook Plugin metabox into the edit * page for each post for which shortlinks * are enabled. */ foreach ($wpbitly_options['post_types'] as $post_type) { add_action('add_meta_boxes_' . $post_type, 'wpbitly_add_metaboxes'); } /** * Callback for add_meta_boxes-{posttype} */ function wpbitly_add_metaboxes($post) { global $post; $shortlink = wp_get_shortlink(); if (empty($shortlink)) { return; } add_meta_box('wpbitly-meta', 'WP Bit.ly', 'wpbitly_build_metabox', $post->post_type, 'side', 'default', array($shortlink)); } /**
private function _refresh_options($defaults) { $this->options = wpbitly_get_options(); }