/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/includes/admin
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/includes/admin/misc-functions.php (6576B)
'' ]; // Blank option
if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
return $post_options;
}
$args = wp_parse_args(
$query_args,
[
'post_type' => 'page',
'numberposts' => 10,
]
);
$posts = get_posts( $args );
if ( $posts ) {
foreach ( $posts as $post ) {
$post_options[ $post->ID ] = $post->post_title;
}
}
return $post_options;
}
/**
* Featured Image Sizes
*
* Outputs an array for the "Featured Image Size" option found under Settings > Display Options.
*
* @since 1.4
*
* @global $_wp_additional_image_sizes
*
* @return array $sizes
*/
function give_get_featured_image_sizes() {
global $_wp_additional_image_sizes;
$sizes = [];
$get_sizes = get_intermediate_image_sizes();
$core_image_sizes = [ 'thumbnail', 'medium', 'medium_large', 'large' ];
// This will help us to filter special characters from a string
$filter_slug_items = [ '_', '-' ];
foreach ( $get_sizes as $_size ) {
// Converting image size slug to title case
$sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items );
if ( in_array( $_size, $core_image_sizes ) ) {
$sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
$sizes[ $_size ] .= " ({$_wp_additional_image_sizes[ $_size ]['width']} x {$_wp_additional_image_sizes[ $_size ]['height']}";
}
// Based on the above image height check, label the respective resolution as responsive
if ( ( array_key_exists( $_size, $_wp_additional_image_sizes ) && ! $_wp_additional_image_sizes[ $_size ]['crop'] ) || ( in_array( $_size, $core_image_sizes ) && ! get_option( "{$_size}_crop" ) ) ) {
$sizes[ $_size ] .= ' - responsive';
}
$sizes[ $_size ] .= ')';
}
return apply_filters( 'give_get_featured_image_sizes', $sizes );
}
/**
* Slug to Title
*
* Converts a string with hyphen(-) or underscores(_) or any special character to a string with Title case
*
* @since 1.8.8
*
* @param string $string
* @param array $filters
*
* @return string $string
*/
function give_slug_to_title( $string, $filters = [] ) {
foreach ( $filters as $filter_item ) {
$string = str_replace( $filter_item, ' ', $string );
}
// Return updated string after converting it to title case
return ucwords( $string );
}
/**
* Display the API Keys
*
* @since 1.0
* @return void
*/
function give_api_callback() {
if ( ! current_user_can( 'manage_give_settings' ) ) {
return;
}
/**
* Fires before displaying API keys.
*
* @since 1.0
*/
do_action( 'give_tools_api_keys_before' );
require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
$api_keys_table = new Give_API_Keys_Table();
$api_keys_table->prepare_items();
$api_keys_table->display();
?>
GiveWP REST API to retrieve donation data in JSON or XML for external applications or devices, such as Zapier.', 'give' ),
esc_url( 'http://docs.givewp.com/api' ),
esc_url( 'http://docs.givewp.com/addon-zapier' )
);
?>
\\1', $readme );
$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', '
\\1', $readme );
$readme = preg_replace( '/[\040]\*(.*?)\*/', '
\\1', $readme );
$readme = preg_replace( '/= (.*?) =/', '
\\1
', $readme );
$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '
\\1', $readme );
return $readme;
}
/**
* Add-ons Render Feed
*
* Renders the add-ons page feed.
*
* @param string $feed_type
* @param bool $echo
*
* @return string
* @since 1.0
*/
function give_add_ons_feed( $feed_type = '', $echo = true ) {
$addons_debug = false; // set to true to debug. NEVER LEAVE TRUE IN PRODUCTION.
$cache_key = $feed_type ? "give_add_ons_feed_{$feed_type}" : 'give_add_ons_feed';
$cache = Give_Cache::get( $cache_key, true );
$feed_url = Give_License::get_website_url() . 'downloads/feed/';
if ( false === $cache || ( true === $addons_debug && true === WP_DEBUG ) ) {
switch ( $feed_type ) {
case 'price-bundle':
$feed_url = Give_License::get_website_url() . 'downloads/feed/addons-price-bundles.php';
break;
case 'addons-directory':
$feed_url = Give_License::get_website_url() . 'downloads/feed/index.php';
break;
}
if ( function_exists( 'vip_safe_wp_remote_get' ) ) {
$feed = vip_safe_wp_remote_get( $feed_url, false, 3, 1, 20, [ 'sslverify' => false ] );
} else {
$feed = wp_remote_get( $feed_url, [ 'sslverify' => false ] );
}
if ( ! is_wp_error( $feed ) ) {
if ( ! empty( $feed['body'] ) ) {
$cache = wp_remote_retrieve_body( $feed );
Give_Cache::set( $cache_key, $cache, DAY_IN_SECONDS, true );
}
} else {
$cache = sprintf(
'
',
esc_html__( 'There was an error retrieving the GiveWP add-ons list from the server. Please try again.', 'give' )
);
}
}
$cache = wp_kses_post( $cache );
if ( $echo ) {
echo $cache;
}
return $cache;
}