Using PODS data with save_post

Yes, whenever a post is saved you should see all of the input items in $_POST … if you’re not using something like xdebug to debug with, you could do something like: echo “<pre>”; var_dump( $_POST ); echo “</pre>”; To test and see what is all included in $_POST … note this is just for … Read more

Use WP admin AJAX url to hide API key

I would break this problem in to 2 parts. First, you could sent an Ajax request to your server, sending only the dataString variable. Then, you can use either cURL or wp_remote_get() on the server to access the real API. This could be the only solution, if you want to avoid playing hide and seek … Read more

Download file using cURL into wp-includes/uploads

There is special wp_upload_bits() function to upload the content to the ‘uploads’ directory. Also, there is no such directory as /wp-includes/upload/. The code was not tested! <?php $video_id = ‘xxxxxxxxxxxxx’; $thumbnail_types = array( ‘0’, ‘1’, ‘2’, ‘3’, ‘default’, ‘sddefault’, ‘mqdefault’, ‘hqdefault’, ‘maxresdefault’, ); foreach( $thumbnail_types as $type ) { $file_name = $type . ‘.jpg’; $youtube_thumb_url=”http://img.youtube.com/vi/” … Read more

WordPress from url get external source title

Here you go: class UrlToTitleConverter{ public function convert($Url){ $response = wp_remote_get($Url); if ( is_array( $response ) ) { $body = $response[‘body’]; $title = substr($body, strpos($body, ‘<title>’)+7); $title = substr($title, 0, strpos($title, ‘</title>’)); } return $title; } }

How to send file by wp_remote_post?

I found an solution for this issue, i using wp_remote_post to send binary of file to server. When processing data received on server, i use this code to get data of file $file = file_get_contents(‘php://input’); And i write it to temp file $temp = tmpfile(); fwrite($temp, $file); $metadata = stream_get_meta_data($temp); Do you have any other … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)