'21',
), $atts));
wp_enqueue_script( 'artfully_event', NME_PLUGIN_URL.'/js/artfully-event.js', false, false, true);
wp_localize_script( 'artfully_event', 'artfully_event', array('eventId' => $id) );
return '
';
}
add_shortcode('art-donation', 'art_donation_data');
function art_donation_data($atts) {
extract(shortcode_atts(array(
'id' => '21',
), $atts));
wp_enqueue_script( 'artfully_donation', NME_PLUGIN_URL.'/js/artfully-donation.js', false, false, true);
wp_localize_script( 'artfully_donation', 'artfully_donation', array('donationId' => $id) );
return '';
}
add_action('admin_enqueue_scripts', 'nme_load_admin_script');
function nme_load_admin_script() {
wp_register_script('artful_setting_js', NME_PLUGIN_URL . '/js/artful-setting.js', array('jquery'));
wp_enqueue_script('artful_setting_js');
wp_localize_script('artful_setting_js','plugin',array('directory' => NME_PLUGIN_URL));
}
add_action('admin_menu', 'nme_artful_menu');
function nme_artful_menu() {
add_options_page('Artful.ly', 'Artful.ly', 'manage_options', 'artful-settings', 'nme_artful_options');
}
function nme_artful_options() {
if (!current_user_can('manage_options')) {
wp_die(__('You do not have sufficient permissions to access this page.'));
}
echo '';
echo '
How to Use the Artful.ly Widget Plugin
';
echo '
Hello! We hope using this plugin will help you integrate artful.ly into your site.';
echo 'All you need to get donations and events into your site is right below.';
echo '
Donations
';
echo 'For donations, you can add a shortcode to your pages.
';
echo 'Here is a sample shortcode for donations :
[art-donation id="organizationID"]';
echo '
Make sure you replace "organizationID" with your actual Organization ID. Organization ID\'s can be found by logging into your artful.ly account.';
echo '
Events
';
echo 'For events, simply add the following shortcode:
[art-event id="eventID"]';
echo '
Make sure you replace "eventID" with your actual event ID. Event IDs can be found by logging into your artful.ly account.';
echo '
Automatically Insert Shortcodes
';
echo '
If you forget the shortcodes, don\'t worry - there\'s a handy button on every post and page to access your
artful.ly content. Look for the little Artful.ly icon on the right side of the buttons above your Visual Editor when you edit a post or page. Simple, wasn\'t it :-)
';
echo '
And of course, if you have any questions, please check out our help pages or submit a support request via our knowledgebase.';
echo 'This plugin was created by
Fractured Atlas, Arrow Root Media and
Punkt Digital';
echo '
';
}
add_action('admin_notices', 'nme_art_notice');
function nme_art_notice() {
if (get_option('art_activated') != 'true') {
echo '
Thanks for activating Artful.ly. Visit your Artful.ly settings page for more info
';
add_option('art_activated', 'true');
} else {
}
}
add_filter('plugin_action_links', 'nme_art_plugin_action_links', 10, 2);
function nme_art_plugin_action_links($links, $file) {
static $this_plugin;
if (!$this_plugin) {
$this_plugin = plugin_basename(__FILE__);
}
if ($file == $this_plugin) {
$settings_link = 'Settings';
array_push($links, $settings_link);
}
return $links;
}
add_action( 'init', 'artfully_buttons' );
function artfully_buttons() {
if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
return;
}
add_filter( 'mce_external_plugins', 'artfully_add_buttons' );
add_filter( 'mce_buttons', 'artfully_register_buttons' );
}
function artfully_add_buttons( $plugin_array ) {
$plugin_array['artfullybutton'] = plugins_url('artfully-widget/lib/tinymce/plugins/artfully-button/artful_editor.js');
return $plugin_array;
}
function artfully_register_buttons( $buttons ) {
array_push( $buttons, 'separator', 'artfulbutton' );
return $buttons;
}
?>