Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1443 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Wordpress / PHP Help

Thread title: Wordpress / PHP Help
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
02-04-2012, 04:22 PM
#1
astereo is offline astereo
astereo's Avatar
Status: Member
Join date: Jun 2005
Location: east coast, usa
Expertise: design,development, & WP
Software: Photoshop, Illustrator, WP
 
Posts: 421
iTrader: 6 / 100%
 

astereo is on a distinguished road

Send a message via AIM to astereo Send a message via Skype™ to astereo

  Old  Wordpress / PHP Help

Hello all,
I'm in the final stages of wrapping up a big theme project for a client, and one of the things they've asked me to integrated is a link cloaker. I found the "Affiliate hide" plugin but I've been tweaking it so it pulls from a specific custom field.

The main function of the plugin is as follows:

PHP Code:
function affiliate_hide() {
global 
$wp_query;

if( isset( 
$wp_query->query_vars['go'] )) {
    
    
$target get_post_meta($wp_query->query_vars['go'], 'url'true);
        if(
$target == '') { 
        
wp_redirect(get_option('siteurl')); exit; // if no blog post redirects to index page.
        
}
    
wp_redirect($target301);
    exit;
    }

The 'url' is referring to the custom field in which the link to be cloaked is found. My problem is that I followed this add meta box tutorial to utilize custom fields in a much nicer interface for my clients clients. This particular tutorials stores everything in an array, so I typically access values like so:

PHP Code:
$my_meta get_post_meta($post->ID,'_my_meta',TRUE);
echo 
$my_meta['link']; 
my problem is being able to grab the 'link' in place of the 'url' in the plugin function. I've tried a wide variety of things but just can't seem to figure it out.

Any help would be appreciated.
Thank you!

     


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed