Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 130709

Method to Update Featured Video with PHP – Make Object->save() public?

$
0
0

Replies: 0

I’ve written some code to automatically add the featured video meta data via a PHP call. The only way for this code to work (from functions.php) is to manually change the Object->save function from “private” to “public”. Since this change will not survive a plugin update I’d like to know if there is a better way to do this or if we can have this change made in the plugin itself.

Thank you!


$video_array = Array(
   'id' => $post->ID,
   'fvp_video' => $featured_video
);
define( 'WSG_DIR', plugin_dir_path( __FILE__ ) );
                                                        require_once(WSG_DIR.'../../plugins/featured-video-plus/php/class-backend.php');

$FVP = new FVP_Backend();
$FVP->save($video_array);

Viewing all articles
Browse latest Browse all 130709

Trending Articles