2012-03-14 8 views
0

그래서 나는 맞춤 대사를 가지고 있으며, 게시물 제목 뒤에 있어야하므로 위치 순서를 설정할 수있는 방법이 있습니까?wordpress metabox 위치를 설정하는 방법

// LE 은 작동하지 않습니다 :

//create a variable and store the widget 
$widget1 = $wp_meta_boxes['dashboard']['normal']['core']['information']; 

// unset both widgets 
unset($wp_meta_boxes['dashboard']['normal']['core']['information']); 

//re insert widget in the order you want 
$wp_meta_boxes['dashboard']['normal']['core']['information'] = $widget1; 

답변

3

이 정상에 대시 보드 위젯을 강제 대한 link이다. 이 이론은 aranging post/page 메타 박스에 사용될 수 있습니다.

//create a variable and store the widget 
$widget1 = $wp_meta_boxes['dashboard']['normal']['core']['your widget id']; 
$widget2 = $wp_meta_boxes['dashboard']['normal']['core']['other widget id']; 

// unset both widgets 
unset($wp_meta_boxes['dashboard']['normal']['core']['your widget id']); 
unset($wp_meta_boxes['dashboard']['normal']['core']['other widget id']); 

//re insert widget in the order you want 
$wp_meta_boxes['dashboard']['normal']['core']['other widget id'] = $widget2; 
$wp_meta_boxes['dashboard']['normal']['core']['your widget id'] = $widget1; 
그들이
$('#pageparentdiv').prependTo('#normal-sortables'); 
$('#panel_38').insertAfter('#pageparentdiv'); 
+0

'// 변수를 생성하고 위젯을 저장 $ WIDGET1 = $ wp_meta_boxes [ '대시 보드'] [ '정상

을 표시 한 후 당신은 또한 상자를 이동 jQuery를 사용할 수

'] ['core '] ['information ']; // 위젯을 모두 설정 해제합니다. unset ($ wp_meta_boxes [ 'dashboard'] [ 'normal'] [ 'core'] [ 'information']); // 원하는 순서로 위젯을 다시 삽입하십시오. $ '[대시 보드]] ['보통 '] ['정보 '] ='$ widget1; '그리고 작동하지 않습니다. – Uffo

+0

코드 샘플은 다음과 같습니다. 대시 보드 위젯 용. 그것은 포스트/페이지 메타 박스를 위해 수정되어야하지만 이론은 여전히 ​​동일합니다. 메타 박스를 변수로 저장하고, 메타 박스를 삭제하고, 변수를 메타 박스로 삽입합니다. – Nick

+0

그래서 내 사용자 정의 게시물 유형에서 나는 다음과 같이 필요합니다 : 게시물 제목, 사용자 정의 metabox, 편집기 등등 ... – Uffo

관련 문제