• Hi all,

    i need to fetch the permalink of all posts within an plugin settings page. When i try to do this:

    $args = array(
                'nopaging' => 1,
                'post_type' => 'any',
                'post_status' => 'any'
            );
            $posts = get_posts($args);
            $permalinks = array();
            foreach ($posts as $post) {
                $permalinks[] += get_permalink($post->ID);
            }

    I get this:

    Array
    (
        [0] => 0
        [1] => 0
        [2] => 0
        [3] => 0
        [4] => 0
        [5] => 0
        [6] => 0
        [7] => 0
        [8] => 0
    )

    Does anyone know how to get the permalinks?

    Thx in advance,
    cu poetter

The topic ‘get_permalink from admin section’ is closed to new replies.