This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class DG_Image_Import | |
* @author Darko Gjorgjijoski <dg@darkog.com> | |
* @license GPLv2 | |
* @copyright 2019 | |
* | |
* Handles import of images from a specific subfolder of your root site dir (eg public_html/your_data_dir) to WordPress media library. | |
* Has basic lock/unlock functionality to avoid colisions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if there is still pending registration for specific username | |
* @param $username | |
* | |
* @return bool | |
*/ | |
function dg_check_pending_registration($username) { | |
global $wpdb; | |
$table = $wpdb->prefix . 'signups'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('str_contains')) { | |
/** | |
* Check if substring is contained in string | |
* | |
* @param $haystack | |
* @param $needle | |
* | |
* @return bool | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the default view privacy in WP Vimeo Videos PRO | |
* This only applies if you have Vimeo Plus, Vimeo PRO, Vimeo Business (or higher level) account. | |
* @url https://developer.vimeo.com/api/guides/videos/interact#set-vimeo-privacy | |
*/ | |
function dgv_default_privacy_1821210($privacy) { | |
$privacy = 'unlisted'; | |
return $privacy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide Upload options on WP Vimeo Videos | |
* @return void | |
*/ | |
function wvv_disable_upload_options() { | |
echo '<style>.dgv-vimeo-form-row label {display:none !important;}</style>'; | |
} | |
add_action('admin_head', 'wvv_disable_upload_options'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide search option in WP Vimeo Videos | |
* @return void | |
*/ | |
function wvv_disable_upload_options() { | |
echo '<style>.dgv-vimeo-upload-form > .dgv-vimeo-form-row > label:last-child { display: none !important;}</style>'; | |
} | |
add_action('admin_head', 'wvv_disable_search_option'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide embed privacy in WP Vimeo Videos | |
* @return void | |
*/ | |
function wvv_edit_hide_embed_privacy() { | |
if(isset($_GET['page']) && $_GET['page'] === 'dgv-library') { | |
echo '<style>#dgv-video-save-embed-privacy {display:none !important;}</style>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="gs-stats silverprice"> | |
<img src="http://www.kitconet.com/images/sp_en_6.gif"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Example 1 - Upload local video | |
$api = new WP_DGV_Api_Helper(); | |
$path = '/home/user/video.mp4'; | |
$params = array( | |
'name' => 'Cool Video', | |
'description' => 'Some description', | |
); |