Wednesday, May 4, 2016

Wordpress default Post Name Change Function.php


<?php

function change_post_menu_label() {

global $menu;

global $submenu;

$menu[5][0] = 'Projects';

$submenu['edit.php'][5][0] = 'Projects';

$submenu['edit.php'][10][0] = 'Add Projects';

$submenu['edit.php'][16][0] = 'Projects Tags';

echo '';

}

function change_post_object_label() {

global $wp_post_types;

$labels = &$wp_post_types['post']->labels;

$labels->name = 'Projects';

$labels->Portfolio = 'Projects';

$labels->add_new = 'Add New';

$labels->add_new_item = 'Add Projects';

$labels->edit_item = 'Edit Projects';

$labels->new_item = 'Projects';

$labels->view_item = 'View Projects';

$labels->search_items = 'Search Projects';

$labels->not_found = 'No Projects found';

$labels->not_found_in_trash = 'No Projects found in Trash';

}

add_action( 'init', 'change_post_object_label' );

add_action( 'admin_menu', 'change_post_menu_label' );



function the_slug() {

    $post_data = get_post($post->ID, ARRAY_A);

    $slug = $post_data['post_name'];

    return $slug;

}

?>


No comments:

Post a Comment