Hi reclifton i made this with my own code. How?
I create a custom template and assign the template to a wp-page.
This is the code:
——————————————————————-
<?php
$url_edit = get_site_url(null,’editar-documento’).’?entry=’;
$url_form_action = get_site_url(null,’editar-documento’); // ‘editar-documento’ is a page created in WP pages admin, with template “Editar documento” (edit-entry.php)
//$url_show_post = get_site_url(null,’mostrar-documento’); // ‘mostrar-documento’ is a page created in WP pages admin, with template “Mostrar documento” (show-entry-post.php)
$current_user_id = get_current_user_id();
$forms = RGFormsModel::get_forms(null,’title’);
foreach( $forms as $form ):
$leads = RGFormsModel::get_leads($form->id);
foreach( $leads as $lead ):
if($lead[‘created_by’]==$current_user_id):
$post = get_post($lead[‘post_id’]);
$post_link = $post->guid;
$originalDate = $lead[‘date_created’];
echo ‘<form action=”‘.$url_form_action.'” method=”post”>’;
echo ‘<input name=”mode” value=”edit” type=”hidden”>’;
echo ‘<input name=”edit_id” value=”‘.$lead[‘id’].'” type=”hidden”>’;
echo ‘<input name=”formID” value=”‘.$form->id.'” type=”hidden”>’;
echo $form->title;
//echo ‘ ,Autor: ‘.$lead[‘created_by’];
echo ‘<br/>’._(“Creado el “).date(“d-m-Y”, strtotime($originalDate));
echo ‘<button class=”sticky-list-edit submit”><span aria-hidden=”true” class=”icon_pencil”></span></button>’;
//echo ‘id.'”>Editar‘;
//print_r($lead);
if($post_link):
echo ‘ ‘.__(“Ver documento”).’ </form>’;
endif;
//echo ‘——————————————————-<br>’;
//print_r($post);
endif;
endforeach;
endforeach;
?>
————————————————————————–
I hope this help to you
There are two ways to do this.
Option 1. Put this in a template file:
echo do_shortcode( "[stickylist id='1' user='" . get_current_user_id() . "']");
Option 2. Put this in functions.php
add_filter('filter_entries','hide_some_rows' );
function hide_some_rows($entries) {
foreach ($entries as $entryKey => $entryValue) {
if ($entryValue["creaded_by"] != get_current_user_id()) {
unset($entries[$entryKey]);
}
}
return $entries;
}
-
This reply was modified 8 years, 8 months ago by
fried_eggz.
-
This reply was modified 8 years, 8 months ago by
fried_eggz.