user12289
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Fixing WordPress
In reply to: get_post() return content without permalinks- what to doYes, it is. Why not?
Forum: Fixing WordPress
In reply to: get_post() return content without permalinks- what to doMy function
function linkReplace($post_content){ if(preg_match_all('#href="/\?page_id=(\d*?)"#i', $post_content, $m)){ $search = array(); $replace = array(); foreach ($m[1] as $page_id) { $search[] = '/?page_id='.$page_id; $replace[] = get_permalink($page_id); } return str_replace($search, $replace, $post_content); } return $post_content; }Forum: Fixing WordPress
In reply to: get_post() return content without permalinks- what to doI think it’s a bug
Forum: Fixing WordPress
In reply to: get_post() return content without permalinks- what to doBut how can i use php code in post’s content (admin-posts-all posts- edit)? It doesn’t work.
Forum: Fixing WordPress
In reply to: get_post() return content without permalinks- what to doI have such content in my page (page id 100)
bla bla bla <a href="/?page_id=1345">click</a> bla bla blaIn my plugin i have such code
$product_post = get_post(100); echo $product_post->post_contentThen i activate my plugin i have such html-code
bla bla bla <a href="/?page_id=1345">click</a> bla bla blabut i want
bla bla bla <a href="/good_result">click</a> bla bla blawhere “/good_result” is the permalink for page with id 1345.
P.S. In settings->permalins i have value “Post name”
Viewing 5 replies - 1 through 5 (of 5 total)