{"id":758,"date":"2022-06-25T16:48:24","date_gmt":"2022-06-25T12:18:24","guid":{"rendered":"https:\/\/wpdone.ir\/docs\/?post_type=help&#038;p=758"},"modified":"2022-06-25T16:50:06","modified_gmt":"2022-06-25T12:20:06","slug":"hooks-edit-profile","status":"publish","type":"help","link":"https:\/\/wpdone.ir\/docs\/help\/hooks-edit-profile\/","title":{"rendered":"\u0648\u06cc\u0631\u0627\u06cc\u0634 \u067e\u0631\u0648\u0641\u0627\u06cc\u0644"},"content":{"rendered":"\n<p>\u0634\u0645\u0627 \u0645\u06cc\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0642\u0644\u0627\u0628 \u0647\u0627\u06cc \u0641\u0631\u0645 \u0648\u06cc\u0631\u0627\u06cc\u0634 \u067e\u0631\u0648\u0641\u0627\u06cc\u0644\u060c \u0645\u0648\u0627\u0631\u062f \u062c\u062f\u06cc\u062f\u062a\u0631\u06cc \u0628\u0647 \u0622\u0646 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">amzshyar_woocommerce_form_edit_account_custom<\/h2>\n\n\n\n<p>\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646 \u0642\u0644\u0627\u0628 \u0645\u06cc\u062a\u0648\u0627\u0646\u06cc\u062f \u0641\u0631\u0645 \u0648\u06cc\u0631\u0627\u06cc\u0634 \u067e\u0631\u0648\u0641\u0627\u06cc\u0644 \u0642\u0627\u0644\u0628 \u0631\u0627 \u0628\u0647 \u067e\u06cc\u0634\u0641\u0631\u0636 \u0648\u0648\u06a9\u0627\u0645\u0631\u0633 \u0628\u0627\u0632\u06af\u0631\u062f\u0627\u0646\u06cc\u062f:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; gutter: false; title: ; notranslate\" title=\"\">\nadd_filter( 'amzshyar_woocommerce_form_edit_account_custom', '__return_false', 1001 );\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">amzshyar_account_phone_notice<\/h2>\n\n\n\n<p>\u067e\u06cc\u063a\u0627\u0645 \u0639\u062f\u0645 \u062b\u0628\u062a \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0631\u0627 \u062d\u0630\u0641 \u0645\u06cc\u06a9\u0646\u062f:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; gutter: false; title: ; notranslate\" title=\"\">\nadd_filter( 'amzshyar_account_phone_notice', '__return_false' );\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">amzshyar_account_email_notice<\/h2>\n\n\n\n<p>\u067e\u06cc\u063a\u0627\u0645 \u0639\u062f\u0645 \u062b\u0628\u062a \u0622\u062f\u0631\u0633 \u0627\u06cc\u0645\u06cc\u0644 \u0631\u0627 \u062d\u0630\u0641 \u0645\u06cc\u06a9\u0646\u062f:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; gutter: false; title: ; notranslate\" title=\"\">\nadd_filter( 'amzshyar_account_email_notice', '__return_false' );\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">amzshyar_form_edit_account_field<\/h2>\n\n\n\n<p>\u0627\u0641\u0632\u0648\u062f\u0646 \u0641\u06cc\u0644\u062f \u062f\u0644\u062e\u0648\u0627\u0647 \u0628\u0647 \u0641\u0631\u0645 \u0648\u06cc\u0631\u0627\u06cc\u0634 \u067e\u0631\u0648\u0641\u0627\u06cc\u0644 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_action( 'amzshyar_form_edit_account_field', function () {\n    $user = wp_get_current_user();\n    if( ! empty( $user-&gt;ID ) ) {\n?&gt;\n    &lt;p&gt;\n        &lt;label for=&quot;field_1&quot;&gt;\u0641\u06cc\u0644\u062f \u0622\u0632\u0645\u0627\u06cc\u0634\u06cc&lt;\/label&gt;\n        &lt;input type=&quot;text&quot; name=&quot;field_1&quot; id=&quot;field_1&quot; value=&quot;&lt;?php echo $user-&gt;field_1; ?&gt;&quot;&gt;\n    &lt;\/p&gt;\n    &lt;p&gt;\n        &lt;label for=&quot;field_2&quot;&gt;\u0641\u06cc\u0644\u062f \u0622\u0632\u0645\u0627\u06cc\u0634\u06cc \u06f2&lt;\/label&gt;\n        &lt;input type=&quot;text&quot; name=&quot;field_2&quot; id=&quot;field_2&quot; value=&quot;&lt;?php echo $user-&gt;field_2; ?&gt;&quot;&gt;\n    &lt;\/p&gt;\n&lt;?php\n    }\n} );\n<\/pre><\/div>\n\n\n<p>\u0646\u06a9\u062a\u0647: \u0646\u0627\u0645 \u0647\u0627\u06cc <strong>field_1<\/strong> \u0648 <strong>field_2<\/strong> \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644 \u062f\u0631\u062c \u0634\u062f\u0647\u200c\u0627\u0646\u062f.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">amzshyar_form_edit_account_save<\/h2>\n\n\n\n<p>\u062f\u0631\u06cc\u0627\u0641\u062a \u0648\u0631\u0648\u062f\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0648 \u0630\u062e\u06cc\u0631\u0647 \u0622\u0646:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_action( 'amzshyar_form_edit_account_save', function ( $user_id ) {\n    if( ! empty( $_POST&#91; 'field_1' ] ) ) {\n        update_user_meta( $user_id, 'field_1', $_POST&#91; 'field_1' ] );\n    }\n    \n    if( ! empty( $_POST&#91; 'field_2' ] ) ) {\n        update_user_meta( $user_id, 'field_2', $_POST&#91; 'field_2' ] );\n    }\n} );\n<\/pre><\/div>\n\n\n<p><strong>\u0646\u06a9\u062a\u0647:<\/strong> \u062f\u0631 \u0627\u06cc\u0646 \u06a9\u062f \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644 \u062f\u0627\u062f\u0647 \u0647\u0627 \u062f\u0631 \u062c\u062f\u0648\u0644 <strong>usermeta<\/strong> \u0630\u062e\u06cc\u0631\u0647 \u0645\u06cc\u0634\u0648\u0646\u062f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0634\u0645\u0627 \u0645\u06cc\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0642\u0644\u0627\u0628 \u0647\u0627\u06cc \u0641\u0631\u0645 \u0648\u06cc\u0631\u0627\u06cc\u0634 \u067e\u0631\u0648\u0641\u0627\u06cc\u0644\u060c \u0645\u0648\u0627\u0631\u062f \u062c\u062f\u06cc\u062f\u062a\u0631\u06cc \u0628\u0647 \u0622\u0646 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n","protected":false},"template":"","help-category":[26],"class_list":["post-758","help","type-help","status-publish","hentry","help-category-hooks"],"_links":{"self":[{"href":"https:\/\/wpdone.ir\/docs\/wp-json\/wp\/v2\/help\/758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpdone.ir\/docs\/wp-json\/wp\/v2\/help"}],"about":[{"href":"https:\/\/wpdone.ir\/docs\/wp-json\/wp\/v2\/types\/help"}],"wp:attachment":[{"href":"https:\/\/wpdone.ir\/docs\/wp-json\/wp\/v2\/media?parent=758"}],"wp:term":[{"taxonomy":"help-category","embeddable":true,"href":"https:\/\/wpdone.ir\/docs\/wp-json\/wp\/v2\/help-category?post=758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}