Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../includes/features
File: functions.php
[1500] Fix | Delete
// HIDE/SHOW TAG AND CATEGORY #4326
[1501] Fix | Delete
function ampforwp_get_taxonomy_meta($term_id,$type=''){
[1502] Fix | Delete
if($type=='' || $type=='data'){
[1503] Fix | Delete
$amp_taxonomy = get_term_meta( $term_id,'amp_taxonomy');
[1504] Fix | Delete
$amp_hide_tax = get_term_meta( $term_id,'amp_hide_tax');
[1505] Fix | Delete
$data = array('visible'=>$amp_taxonomy,'visible_status'=>$amp_hide_tax);
[1506] Fix | Delete
return $data;
[1507] Fix | Delete
}else if($type=='status'){
[1508] Fix | Delete
$amp_taxonomy = get_term_meta( $term_id,'amp_taxonomy');
[1509] Fix | Delete
if(isset($amp_taxonomy[0]) && $amp_taxonomy[0]=='hide'){
[1510] Fix | Delete
return false;
[1511] Fix | Delete
}else{
[1512] Fix | Delete
return true;
[1513] Fix | Delete
}
[1514] Fix | Delete
}else if($type=='post_status'){
[1515] Fix | Delete
$term = wp_get_post_terms(ampforwp_get_the_ID(),array('category','post_tag'));
[1516] Fix | Delete
foreach ($term as $key => $value) {
[1517] Fix | Delete
$amp_taxonomy = get_term_meta( $value->term_id,'amp_taxonomy');
[1518] Fix | Delete
$amp_hide_tax = get_term_meta( $value->term_id,'amp_hide_tax');
[1519] Fix | Delete
if(isset($amp_taxonomy[0]) && $amp_taxonomy[0]=='hide' && $amp_hide_tax[0]=='hide-tax-post'){
[1520] Fix | Delete
return false;
[1521] Fix | Delete
}
[1522] Fix | Delete
}
[1523] Fix | Delete
return true;
[1524] Fix | Delete
}
[1525] Fix | Delete
}
[1526] Fix | Delete
[1527] Fix | Delete
function ampforwp_internal_feedback_notice(){
[1528] Fix | Delete
$install_date = get_option('ampforwp_plugin_info');
[1529] Fix | Delete
if (isset($install_date["activation_data"])) {
[1530] Fix | Delete
$install_date = $install_date["activation_data"];
[1531] Fix | Delete
$install_date = date("m-d-Y", $install_date);
[1532] Fix | Delete
}
[1533] Fix | Delete
$activation_never = get_option("ampforwp_feedback_remove_notice");
[1534] Fix | Delete
if (strtotime($install_date) < strtotime('-30 days') && $activation_never !='remove') {?>
[1535] Fix | Delete
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
[1536] Fix | Delete
<p>
[1537] Fix | Delete
<?php esc_html_e('Awesome, you\'ve been using AMPforWP for more than 1 month. May I ask you to give it a 5-star rating on WordPress.org?', 'accelerated-mobile-pages'); ?></br>
[1538] Fix | Delete
<?php esc_html_e('This will help spread the word out about this plugin and will encourage us to continue the development.', 'accelerated-mobile-pages'); ?></br>
[1539] Fix | Delete
<?php esc_html_e('Much appreciated, thank you very much.', 'accelerated-mobile-pages'); ?></br></br>
[1540] Fix | Delete
<a href="https://wordpress.org/support/plugin/accelerated-mobile-pages/reviews/?rate=5#new-post" class="button-primary" target="_new" style="font-weight:bold;" title="Ok, you deserved it"> <?php echo esc_html__('Ok, You deserve it', 'accelerated-mobile-pages') ?></a>
[1541] Fix | Delete
<a class="button-primary" id="ampforwp-close-notice" style="font-weight:bold;"><?php echo esc_html__('Not Now', 'accelerated-mobile-pages') ?></a>
[1542] Fix | Delete
</p>
[1543] Fix | Delete
</div>
[1544] Fix | Delete
<?php }
[1545] Fix | Delete
}
[1546] Fix | Delete
function ampforwp_feedback_remove_notice(){
[1547] Fix | Delete
$result = update_option( "ampforwp_feedback_remove_notice", 'remove', false);
[1548] Fix | Delete
if($result){
[1549] Fix | Delete
echo wp_json_encode(array('status'=>'t'));
[1550] Fix | Delete
}else{
[1551] Fix | Delete
echo wp_json_encode(array('status'=>'f'));
[1552] Fix | Delete
}
[1553] Fix | Delete
wp_die();
[1554] Fix | Delete
}
[1555] Fix | Delete
add_action('wp_ajax_ampforwp_feedback_remove_notice', 'ampforwp_feedback_remove_notice');
[1556] Fix | Delete
[1557] Fix | Delete
function ampforwp_pro_extension_manager_notice(){?>
[1558] Fix | Delete
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
[1559] Fix | Delete
<p>
[1560] Fix | Delete
<?php echo esc_html__('AMP Pro Extension Manager has been activated, Please enter your license key', 'accelerated-mobile-pages'); ?>
[1561] Fix | Delete
<a href="<?php echo esc_url(admin_url('admin.php?page=amp-extension-manager')) ?>" style="font-weight:bold;"> <?php echo esc_html__('here', 'accelerated-mobile-pages') ?></a>
[1562] Fix | Delete
</p>
[1563] Fix | Delete
</div>
[1564] Fix | Delete
<?php }
[1565] Fix | Delete
[1566] Fix | Delete
function ampforwp_incomplate_setup_notice(){?>
[1567] Fix | Delete
<div class="updated notice ampforwp_remove_notice">
[1568] Fix | Delete
<p>
[1569] Fix | Delete
<?php esc_html_e('Your setup is not completed. Please setup for better AMP Experience', 'accelerated-mobile-pages'); ?>
[1570] Fix | Delete
</p>
[1571] Fix | Delete
</div>
[1572] Fix | Delete
<?php }
[1573] Fix | Delete
[1574] Fix | Delete
function ampforwp_tpd_notice(){
[1575] Fix | Delete
$remove_notice = get_option("ampforwp_tpd_remove_notice");
[1576] Fix | Delete
if ($remove_notice !='remove' && !ampforwp_get_setting('ampforwp-ads-publisherdesk')) { ?>
[1577] Fix | Delete
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
[1578] Fix | Delete
<p>
[1579] Fix | Delete
<?php echo sprintf( 'We have integrated <a href="https://www.publisherdesk.com/amp-for-wp/" target="_blank">%s</a> in our AMP plugin, it is a revenue optimization platform that helps publishers increase their ad revenue with fast fetch ad delivery and publishers can get upto 2x of the revenue compared to non-optimized pages',esc_html__('The Publisher Desk','accelerated-mobile-pages' ));?></p>
[1580] Fix | Delete
<a href="<?php echo esc_url('admin.php?page=amp_options&tab=4') ?>" class="button-primary" target="_self" style="font-weight:bold;" title="Ok, you deserved it"> <?php echo esc_html__('Setup The Publisher Desk in AMP', 'accelerated-mobile-pages') ?></a>
[1581] Fix | Delete
<a class="button-primary" id="ampforwp-close-ad-notice" style="font-weight:bold;"><?php echo esc_html__('Dismiss', 'accelerated-mobile-pages') ?></a>
[1582] Fix | Delete
</p>
[1583] Fix | Delete
</div>
[1584] Fix | Delete
<?php }
[1585] Fix | Delete
}
[1586] Fix | Delete
// added ajax hook here.
[1587] Fix | Delete
add_action( 'wp_ajax_ampforwp_tpd_remove_notice', 'ampforwp_tpd_remove_notice' );
[1588] Fix | Delete
function ampforwp_tpd_remove_notice(){
[1589] Fix | Delete
$result = '';
[1590] Fix | Delete
if(current_user_can( 'manage_options' )){
[1591] Fix | Delete
$result = update_option( "ampforwp_tpd_remove_notice", 'remove', false);
[1592] Fix | Delete
}
[1593] Fix | Delete
if($result){
[1594] Fix | Delete
echo wp_json_encode(array('status'=>'t'));
[1595] Fix | Delete
}else{
[1596] Fix | Delete
echo wp_json_encode(array('status'=>'f'));
[1597] Fix | Delete
}
[1598] Fix | Delete
wp_die();
[1599] Fix | Delete
}
[1600] Fix | Delete
/*
[1601] Fix | Delete
* AMP Visibility Shortcode
[1602] Fix | Delete
* @since 1.0.94
[1603] Fix | Delete
* It is used to display or hide the page content based on parameters passed to the shortcode.
[1604] Fix | Delete
*/
[1605] Fix | Delete
function ampforwp_visibility_shortcode($atts, $content = null) {
[1606] Fix | Delete
// Extract shortcode attributes
[1607] Fix | Delete
$atts = shortcode_atts(
[1608] Fix | Delete
array(
[1609] Fix | Delete
'mode' => 'amp', // Default mode is AMP
[1610] Fix | Delete
'visibility' => 'show' // Default visibility is show
[1611] Fix | Delete
),
[1612] Fix | Delete
$atts,
[1613] Fix | Delete
'ampforwp_visibility'
[1614] Fix | Delete
);
[1615] Fix | Delete
[1616] Fix | Delete
// Check if AMP mode is enabled
[1617] Fix | Delete
if ((function_exists('is_amp_endpoint') && is_amp_endpoint()) || (function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint())) {
[1618] Fix | Delete
// If in AMP mode and mode attribute is set to amp, check visibility attribute
[1619] Fix | Delete
if ($atts['mode'] === 'amp') {
[1620] Fix | Delete
// If visibility attribute is set to show, return the content
[1621] Fix | Delete
if ($atts['visibility'] === 'show') {
[1622] Fix | Delete
return do_shortcode($content);
[1623] Fix | Delete
} else {
[1624] Fix | Delete
// If visibility attribute is set to hide, return an empty string
[1625] Fix | Delete
return '';
[1626] Fix | Delete
}
[1627] Fix | Delete
} else {
[1628] Fix | Delete
// If in AMP mode and mode attribute is set to non-amp, return an empty string
[1629] Fix | Delete
return '';
[1630] Fix | Delete
}
[1631] Fix | Delete
} else {
[1632] Fix | Delete
// If not in AMP mode and mode attribute is set to non-amp, check visibility attribute
[1633] Fix | Delete
if ($atts['mode'] === 'non-amp') {
[1634] Fix | Delete
// If visibility attribute is set to show, return the content
[1635] Fix | Delete
if ($atts['visibility'] === 'show') {
[1636] Fix | Delete
return do_shortcode($content);
[1637] Fix | Delete
} else {
[1638] Fix | Delete
// If visibility attribute is set to hide, return an empty string
[1639] Fix | Delete
return '';
[1640] Fix | Delete
}
[1641] Fix | Delete
} else {
[1642] Fix | Delete
// If not in AMP mode and mode attribute is set to amp, return an empty string
[1643] Fix | Delete
return '';
[1644] Fix | Delete
}
[1645] Fix | Delete
}
[1646] Fix | Delete
}
[1647] Fix | Delete
add_shortcode('ampforwp_visibility', 'ampforwp_visibility_shortcode');
[1648] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function