{"id":4100796,"date":"2013-09-06T01:10:12","date_gmt":"2013-09-06T01:10:12","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/help-allowing-client-to-add-project\/"},"modified":"2016-08-21T04:39:01","modified_gmt":"2016-08-21T04:39:01","slug":"help-allowing-client-to-add-project","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/help-allowing-client-to-add-project\/","title":{"rendered":"Help Allowing Client to Add Project"},"content":{"rendered":"<p>Hi, I love this plug-in. Hope you don&#8217;t mind me altering it. I&#8217;m trying to  use it as a way for parents to log their volunteer time in order to earn tuition discounts at their kids&#8217; school.  I&#8217;d like to allow the &#8220;client&#8221; or principal add her own projects. I&#8217;m altering the client frontend to do this. I&#8217;m able to get the add project form to work, but it&#8217;s no updating the table. Could you please take a look at this code and tell me what I&#8217;m doing wrong? I&#8217;m more a vb person so this is new territory for me. \ud83d\ude42 Thank you!<\/p>\n<pre><code>function print_frontend_task_form( $client_id ){\n\t$x = Array();\n\t\t$what = __(&#039;Add New Project&#039;,NDZ);\n\t\t?&gt;\n\t\t&lt;h2 id=&quot;add-project&quot;&gt;&lt;?php echo $what; ?&gt;&lt;\/h2&gt;\n\t\t&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo get_permalink( get_option( &#039;Ndizi Frontend Page&#039; ) ); ?&gt;&quot;&gt;\n\t\t\t&lt;?php $this-&gt;_form_row( &#039;ndizi_action&#039;, NULL, &#039;frontend_add_project&#039;, &#039;hidden&#039; ); ?&gt;\n\t\t\t&lt;?php if( !is_null( $id ) ) $this-&gt;_form_row( &#039;project_id&#039;, NULL, $x[&#039;project_id&#039;], &#039;hidden&#039; ); ?&gt;\n\t\t\t&lt;table class=&quot;form-table&quot;&gt;\n\t\t\t&lt;tbody&gt;\n\n\t\t\t\t&lt;?php\t$this-&gt;_form_row( &#039;name&#039;,\t\t\t__(&#039;Project Name&#039;,NDZ),\t\t\t$this-&gt;_val($x,&#039;project_name&#039;) \t\t\t\t\t\t);\n\t\t\t\t\t\t$this-&gt;_form_row( &#039;description&#039;,\t__(&#039;Project Description&#039;,NDZ),\t$this-&gt;_val($x,&#039;project_description&#039;),\t&#039;wysiwyg&#039;\t);\n\t\t\t\t\t\t$this-&gt;_form_row( &#039;client_id&#039;,\t\t__(&#039;Client&#039;,NDZ),\t\t\t\t$this-&gt;_val($x,&#039;project_client_id&#039;),\t&#039;clients&#039;\t);\n\t\t\t\t\t\t$this-&gt;_form_row( &#039;active&#039;,\t\t\t__(&#039;Active&#039;,NDZ),\t\t\t\t$this-&gt;_val($x,&#039;project_active&#039;,&#039;y&#039;),\t&#039;yn&#039; \t\t);\n\t\t\t\t\t\t$this-&gt;_form_row( &#039;submit&#039;,\t\t\tNULL,\t\t\t\t\t\t\t$what,\t\t\t\t\t\t\t\t\t&#039;submit&#039;\t);\n\t\t\t\t?&gt;\n\n\t\t\t&lt;\/tbody&gt;\n\t\t\t&lt;\/table&gt;\n\t\t&lt;\/form&gt;\n\n\t\t&lt;?php\n\t}\n\n\tfunction frontend_add_project($id = NULL ){\n\t\t$params = Array(\n\t\t\t&#039;client_id&#039;\t\t=&gt;\t&#039;client_id&#039;,\n\t\t\t&#039;project_name&#039;\t=&gt;\t&#039;name&#039;,\n\t\t\t&#039;description&#039;\t=&gt;\t&#039;description&#039;,\n\t\t\t&#039;active&#039;\t\t=&gt;\t&#039;active&#039;,\n\t\t);\n\t\t$args = $this-&gt;_params_to_args( $params, $_POST );\n\t\tif( !$args ) return;\n\t\treturn $this-&gt;add_project( $args );\n\t}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-4100796","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4100796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4100796\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4100796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}