Jump to content


Photo

Probably a simple code formating problem


  • Please log in to reply
2 replies to this topic

#1 elsnare

elsnare

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 18 October 2013 - 03:20 PM

Hello and thank you for your time.

Long story short I need to put:

<? wpsc_the_custom_fields( 'slug=url-movie')?>
 <?php
        print insert_proplayer(
             array(),
             'RIGHT HERE'
        );
    ?>   

Unfortunately after trying for around 2h I could not make it to work. The custom field returns an url, that should be loaded into the player code.

 

Thanks in advance!



#2 halben

halben

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts

Posted 18 October 2013 - 03:30 PM

<? wpsc_the_custom_fields( 'slug=url-movie')?>

 

 

Add <?php



#3 requinix

requinix

    Hopeless Member

  • Moderators
  • 5,924 posts
  • LocationWA

Posted 18 October 2013 - 08:08 PM

Or maybe you're asking for
<?php
        print insert_proplayer(
             array(),
             // wpsc_the_custom_fields( 'slug=url-movie')
        );
    ?>
which isn't easy because apparently wpsc_the_custom_fields() outputs information instead of returning it. Which is one of the reasons why every good developer I know personally loathes WordPress.

You'd have to do stupid crap with output buffering
<?php
        ob_start();
        wpsc_the_custom_fields( 'slug=url-movie');
        print insert_proplayer(
             array(),
             ob_get_clean()
        );
    ?>
Can you modify insert_proplayer() to not need that wpsc_the_custom_fields() as an argument? It's all getting printed anyways.

Edited by requinix, 18 October 2013 - 08:08 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com