: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'default' => '[count] followers',
'instafeedColumnsGap' => [
'instafeedPostsPerPage' => [
'instafeedLikesCount' => [
'instafeedCommentsCount' => [
'instafeedPopupFollowBtn' => [
'instafeedPopupFollowBtnLabel' => [
'instafeedLoadmoreLabel' => [
'default' => 'Load More',
'hideCookieBanner' => array(
'hideEventTypeDetails' => array(
'cBackgroundColor' => array(
'cButtonLinkColor' => array(
'cPopupButtonText' => array(
'default' => 'Schedule time with me'
'cPopupButtonBGColor' => array(
'cPopupButtonTextColor' => array(
'cPopupLinkText' => array(
'default' => 'Schedule time with me'
} elseif ('embedpress-pdf' === $blocks_to_register) {
register_block_type('embedpress/embedpress-pdf', [
// 'default' => (int) get_options_value('enableEmbedResizeHeight')
// 'default' => (int) get_options_value('enableEmbedResizeWidth')
'default' => get_options_value('custom_color')
'default' => 'Content Locked'
'default' => 'Content is locked and requires password to access it.'
'passwordPlaceholder' => [
'submitUnlockingText' => [
'default' => 'Oops, that wasn\'t the right password. Try again.'
'enableFooterMessage' => [
'default' => 'In case you don\'t have the password, kindly reach out to content owner or administrator to request access.'
'flipbook_toolbar_position' => [
'render_callback' => 'embedpress_pdf_render_block',
} elseif ('embedpress-calendar' === $blocks_to_register) {
register_block_type('embedpress/embedpress-calendar', [
'render_callback' => 'embedpress_calendar_render_block',
} elseif ('document' === $blocks_to_register) {
register_block_type('embedpress/' . $blocks_to_register, [
// 'render_callback' => 'embedpress_document_render_block',
register_block_type('embedpress/' . $blocks_to_register);
if (WP_Block_Type_Registry::get_instance()->is_registered('embedpress/' . $blocks_to_register)) {
unregister_block_type('embedpress/' . $blocks_to_register);
add_action('init', 'embedpress_gutenberg_register_all_block');
function getParamData($attributes)
'themeMode' => !empty($attributes['themeMode']) ? $attributes['themeMode'] : 'default',
'toolbar' => !empty($attributes['toolbar']) ? 'true' : 'false',
'position' => $attributes['position'],
'presentation' => !empty($attributes['presentation']) ? 'true' : 'false',
'download' => !empty($attributes['download']) ? 'true' : 'false',
'copy_text' => !empty($attributes['copy_text']) ? 'true' : 'false',
'add_text' => !empty($attributes['add_text']) ? 'true' : 'false',
'draw' => !empty($attributes['draw']) ? 'true' : 'false',
'doc_rotation' => !empty($attributes['doc_rotation']) ? 'true' : 'false',
'add_image' => !empty($attributes['add_image']) ? 'true' : 'false',
'doc_details' => !empty($attributes['doc_details']) ? 'true' : 'false',
'zoom_in' => !empty($attributes['zoomIn']) ? 'true' : 'false',
'zoom_out' => !empty($attributes['zoomOut']) ? 'true' : 'false',
'fit_view' => !empty($attributes['fitView']) ? 'true' : 'false',
'bookmark' => !empty($attributes['bookmark']) ? 'true' : 'false',
'flipbook_toolbar_position' => !empty($attributes['flipbook_toolbar_position']) ? $attributes['flipbook_toolbar_position'] : 'bottom',
if ($urlParamData['themeMode'] == 'custom') {
$urlParamData['customColor'] = !empty($attributes['customColor']) ? $attributes['customColor'] : '#403A81';
if (isset($attributes['viewerStyle']) && $attributes['viewerStyle'] == 'flip-book') {
return "&key=" . base64_encode(mb_convert_encoding(http_build_query($urlParamData), 'UTF-8'));
return "#key=" . base64_encode(mb_convert_encoding(http_build_query($urlParamData), 'UTF-8'));
function embedpress_pdf_block_scripts($attributes) {
$script_handles[] = 'embedpress-pdfobject';
$script_handles[] = 'embedpress-front';
if(!empty($attributes['adManager'])){
$script_handles[] = 'embedpress-ads';
foreach ($script_handles as $handle) {
wp_enqueue_script($handle);
'embedpress_blocks-cgb-style-css',
foreach ($style_handles as $handle) {
wp_enqueue_style($handle);
function embedpress_pdf_render_block($attributes)
embedpress_pdf_block_scripts($attributes);
if (!empty($attributes['href'])) {
$renderer = Helper::get_pdf_renderer();
$pdf_url = $attributes['href'];
$id = !empty($attributes['id']) ? $attributes['id'] : 'embedpress-pdf-' . rand(100, 10000);
$unitoption = !empty($attributes['unitoption']) ? $attributes['unitoption'] : 'px';
$width = !empty($attributes['width']) ? $attributes['width'] . $unitoption : get_options_value('enableEmbedResizeWidth').'px';
if ($unitoption == '%') {
$width_class = ' ep-percentage-width';
$width_class = 'ep-fixed-width';
$content_share_class = '';
$share_position_class = '';
$share_position = isset($attributes['sharePosition']) ? $attributes['sharePosition'] : 'right';
if (!empty($attributes['contentShare'])) {
$content_share_class = 'ep-content-share-enabled';
$share_position_class = 'ep-share-position-' . $share_position;
$password_correct = isset($_COOKIE['password_correct_' . $client_id]) ? $_COOKIE['password_correct_' . $client_id] : '';
$hash_pass = hash('sha256', wp_salt(32) . md5(isset($attributes['contentPassword']) ? $attributes['contentPassword'] : ''));
$content_protection_class = 'ep-content-protection-enabled';
if (empty($attributes['lockContent']) || empty($attributes['contentPassword']) || $hash_pass === $password_correct) {
$content_protection_class = 'ep-content-protection-disabled';
$height = !empty($attributes['height']) ? $attributes['height'] . 'px' : get_options_value('enableEmbedResizeHeight').'px';
$gen_settings = get_option(EMBEDPRESS_PLG_NAME);
$powered_by = isset($gen_settings['embedpress_document_powered_by']) && 'yes' === $gen_settings['embedpress_document_powered_by'];
if (isset($attributes['powered_by'])) {
$powered_by = $attributes['powered_by'];