Title: Notice: post_permalink is deprecated
Last modified: August 31, 2016

---

# Notice: post_permalink is deprecated

 *  [Paul Bearne](https://wordpress.org/support/users/pbearne/)
 * (@pbearne)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/)
 * Notice: post_permalink is deprecated since version 4.4! Use get_permalink() instead.
   in /home/apcstage/public_html/wp-includes/functions.php on line 3573
 * seems to line 111 in \w3-total-cache\lib\W3\SharedPageUrls.php
 * here is working version of the function
 *     ```
       /**
            * Returns all urls related to a post
            * @param $post_id
            * @return array
            */
           function get_post_urls($post_id) {
               if (!isset($this->post_urls[$post_id])) {
                   $full_urls = array();
                   $post_link = get_permalink($post_id);
                   $post_uri = str_replace($this->domain_url, '', $post_link);
   
                   $full_urls[] = $post_link;
                   $uris[] = $post_uri;
                   $post = get_post($post_id);
                   $matches =array();
                   if ($post && ($post_pages_number = preg_match_all('/\<\!\-\-nextpage\-\-\>/', $post->post_content,$matches))>0) {
                       global $wp_rewrite;
                       $post_pages_number++;
                       for ($pagenum = 2; $pagenum <= $post_pages_number; $pagenum++) {
                           if ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
                               $post_pagenum_link = trailingslashit($post_link) . user_trailingslashit("$wp_rewrite->pagination_base/" . $pagenum, 'single_paged');
                           else
                               $post_pagenum_link = trailingslashit($post_link) . user_trailingslashit($pagenum, 'single_paged');
                           $full_urls[] = $post_pagenum_link;
                       }
                   }
                   $this->post_urls[$post_id] = $full_urls;
               }
               return $this->post_urls[$post_id];
           }
       ```
   
 * [https://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/page/2/?output_format=md)

 *  [muchmuch11](https://wordpress.org/support/users/muchmuch11/)
 * (@muchmuch11)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917395)
 * Hi..
 * I checked on [https://codex.wordpress.org/Version_4.4](https://codex.wordpress.org/Version_4.4)
   this code not listed as deprecated, but on developer.wordpress.org listed as 
   deprecated. Did they missed to add it on version 4.4 changelog?
 *  [jabcka](https://wordpress.org/support/users/jabcka/)
 * (@jabcka)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917407)
 * Should I edit the plugin or there’s going to be a plugin update with this issue?
 *  [Tom Fotherby](https://wordpress.org/support/users/tfotherby/)
 * (@tfotherby)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917450)
 * This issue is affected us too when we reply to a comment from the main comments
   page in the dashboard. WordPress gives a message in red:
 * Notice: post_permalink is deprecated since version 4.4! Use get_permalink() instead.
   in /var/www/pphblog_sandbox/wp-includes/functions.php on line 3573
 * There is only 1 usage of this method in W3 Total Cache:
 * `
    plugins/w3-total-cache/lib/W3/SharedPageUrls.php 111: $post_link = post_permalink(
   $post_id);
 *  [rabin.io](https://wordpress.org/support/users/rabinio/)
 * (@rabinio)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917452)
 * +1 for now I used [@paul](https://wordpress.org/support/users/paul/) Bearne patch
   and replaced the call with `get_permalink`.
    But I hope they will fix it upstream.
 *  [lucabarelli](https://wordpress.org/support/users/lucabarelli/)
 * (@lucabarelli)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917454)
 * Thank you!
 *  [kathyaz](https://wordpress.org/support/users/kathyaz/)
 * (@kathyaz)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917455)
 * I hope W3TC updates soon. In the meantime I disabled the plugin. I was receiving
   multiple different errors. Namely, in these files:
 * wp-includes/functions.php on line 3573
    wp-admin/post.php on line 197 wp-includes/
   pluggable.php on line 1228
 * Not sure about the patch above since it was probably made to address the permalinks
   error but maybe not the other 2 I experienced. Can’t afford to break the site
   at the moment!
 *  [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917456)
 * > **rabin.io:** +1 for now I used [@paul](https://wordpress.org/support/users/paul/)
   > Bearne patch and replaced the call with get_permalink.
 * Same here, thanks, seems to work so far.
 *  [olavxxx](https://wordpress.org/support/users/olavxxx/)
 * (@olavxxx)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917459)
 * I’ve also disabled the plugin for now, had people report they could not update
   posts with this error in the multisite network.
 *  [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917460)
 * [@olavxxx](https://wordpress.org/support/users/olavxxx/): If this PHP notice 
   is shown to users, probably “debug” mode of WordPress is enabled on you site.
   Would recommend to disable it.
 * [https://codex.wordpress.org/WP_DEBUG](https://codex.wordpress.org/WP_DEBUG)
 *  [olavxxx](https://wordpress.org/support/users/olavxxx/)
 * (@olavxxx)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917463)
 * Hi, I know. I turned it on for the purpose of PHP7 compatability.
    It’s just 
   turned on for our internal IP-adress though, I think warnings should be fixed
   before they become errors.
 *  [Irmantas](https://wordpress.org/support/users/nesvarbus/)
 * (@nesvarbus)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917471)
 * > I hope W3TC updates soon. In the meantime I disabled the plugin. I was receiving
   > multiple different errors. Namely, in these files:
   > wp-includes/functions.php on line 3573
   >  wp-admin/post.php on line 197 wp-includes/
   > pluggable.php on line 1228
   > Not sure about the patch above since it was probably made to address the permalinks
   > error but maybe not the other 2 I experienced. Can’t afford to break the site
   > at the moment!
 * I have same issue :/
 *  [Marty](https://wordpress.org/support/users/bozzmedia/)
 * (@bozzmedia)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917472)
 * I wouldn’t hold out much hope of an update soon. The last meaningful update was
   August 2014.
 * At any rate, a deprecated error is not a show stopper so you should be fine continuing
   with the notice. You can hide your debug errors via wp-config
 *  [Little Package](https://wordpress.org/support/users/littlepackage/)
 * (@littlepackage)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917486)
 * Hello,
 * I’d love to see this (use of post_permalink()) fixed in the next update as well,
   please.
 * Thank you!
 *  [iamandrebulatov](https://wordpress.org/support/users/iamandrebulatov/)
 * (@iamandrebulatov)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917487)
 * Sweet, thank you Paul.
 * Can confirm this is still a problem on Version 0.9.4.1. Except function intro
   comment started at line 103 in the same file, in \w3-total-cache\lib\W3\SharedPageUrls.
   php.
 *  Thread Starter [Paul Bearne](https://wordpress.org/support/users/pbearne/)
 * (@pbearne)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/#post-6917488)
 * run the plugin with debug (xDebug) turned on and you will see the error

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/page/2/?output_format=md)

The topic ‘Notice: post_permalink is deprecated’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)
 * [post_permalink](https://wordpress.org/support/topic-tag/post_permalink/)

 * 16 replies
 * 14 participants
 * Last reply from: [Kimberly](https://wordpress.org/support/users/amiga500/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/notice-post_permalink-is-deprecated/page/2/#post-6917489)
 * Status: not resolved