the settings page to enter your Amazon Associate IDs. Version: 1.6 Author: Pete Williams Author URI: http://petewilliams.info */ /* Copyright 2009-2011 Pete Williams (email : plugins@petewilliams.info) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ add_option( 'amzn_com' ); add_option( 'amzn_co_uk' ); add_option( 'amzn_de' ); add_option( 'amzn_fr' ); add_option( 'amzn_ca' ); add_option( 'amzn_jp' ); add_option( 'amzn_it' ); add_option( 'amzn_cn' ); add_action( 'admin_menu', 'amzn_admin_menu'); add_action( 'wp_head', 'amzn_add_js' ); /** * add MENU */ function amzn_admin_menu() { add_options_page('Amazon Affiliate IDs', 'Amazon Affiliate IDs', 8, 'amazon_affiliate_link_localiser', 'amzn_admin_options'); } /** * OPTIONS page */ function amzn_admin_options() { echo "

Amazon Affiliate Link Localizer

"; if ( $_POST['_wpnonce'] ) { update_option( 'amzn_com', $_POST['amzn_com'] ); update_option( 'amzn_co_uk', $_POST['amzn_co_uk'] ); update_option( 'amzn_de', $_POST['amzn_de'] ); update_option( 'amzn_fr', $_POST['amzn_fr'] ); update_option( 'amzn_ca', $_POST['amzn_ca'] ); update_option( 'amzn_jp', $_POST['amzn_jp'] ); update_option( 'amzn_it', $_POST['amzn_it'] ); update_option( 'amzn_cn', $_POST['amzn_cn'] ); echo "

Affiliate IDs updated

"; } echo "
" . wp_nonce_field('update-options') . "

Enter your regional Amazon affiliate IDs below.

Don't worry if you don't have one for each region - just leave it blank.

Amazon.com ID
Amazon.co.uk ID
Amazon.de ID
Amazon.fr ID
Amazon.ca ID
Amazon.co.jp ID
Amazon.it ID
Amazon.cn ID

Plugin by Pete Williams - Follow me on twitter

If you found this plugin useful, please consider donating just $1 so I can justify maintaining it!

"; } /** * generate required JAVASCRIPT */ function amzn_add_js() { // does not use wp_enqueue_script because we need to ensure linked scripts go above the embedded one echo " "; }