Jump to content

Probably a simple code formating problem


elsnare

Recommended Posts

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.